MCPcopy Create free account
hub / github.com/goadesign/goa / isEmpty

Function isEmpty

grpc/codegen/service_data.go:1454–1462  ·  view source on GitHub ↗

isEmpty returns true if given type is empty.

(dt expr.DataType)

Source from the content-addressed store, hash-verified

1452
1453// isEmpty returns true if given type is empty.
1454func isEmpty(dt expr.DataType) bool {
1455 if dt == expr.Empty {
1456 return true
1457 }
1458 if o := expr.AsObject(dt); o != nil && len(*o) == 0 {
1459 return true
1460 }
1461 return false
1462}
1463
1464// hasAnyType recursively checks if the given attribute uses the Any type.
1465func hasAnyType(att *expr.AttributeExpr) bool {

Callers 5

analyzeMethod · 0.70
buildInitDataMethod · 0.70
usesStreamEnvelopeFunction · 0.70

Calls 1

AsObjectFunction · 0.92

Tested by

no test coverage detected