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

Function pkgWithDefault

grpc/codegen/service_data.go:1435–1440  ·  view source on GitHub ↗

pkgWithDefault returns the package name of the given location if not nil, def otherwise.

(loc *codegen.Location, def string)

Source from the content-addressed store, hash-verified

1433
1434// pkgWithDefault returns the package name of the given location if not nil, def otherwise.
1435func pkgWithDefault(loc *codegen.Location, def string) string {
1436 if loc == nil {
1437 return def
1438 }
1439 return loc.PackageName()
1440}
1441
1442// getPrimitive returns the primitive expression if the given expression is an alias to one
1443func getPrimitive(att *expr.AttributeExpr) *expr.AttributeExpr {

Callers 4

analyzeMethod · 0.70
buildErrorsDataMethod · 0.70
resultContextFunction · 0.70

Calls 1

PackageNameMethod · 0.80

Tested by

no test coverage detected