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

Method GoTypeNameWithDefaults

codegen/scope.go:287–292  ·  view source on GitHub ↗

GoTypeNameWithDefaults returns the Go type name of the given attribute type. The result of this function differs from GoTypeName when the attribute type is an object (note: not a user type) and the name is thus an inline struct definition. In this case accounting for default values may cause child a

(att *expr.AttributeExpr)

Source from the content-addressed store, hash-verified

285// definition. In this case accounting for default values may cause child
286// attributes to use non-pointer fields.
287func (s *NameScope) GoTypeNameWithDefaults(att *expr.AttributeExpr) string {
288 if _, ok := att.Type.(*expr.Object); ok {
289 return s.GoTypeDef(att, false, true)
290 }
291 return s.GoTypeName(att)
292}
293
294// GoFullTypeName returns the Go type name of the given data type qualified with
295// the given package name if applicable and if not the empty string.

Callers 2

GoTypeRefWithDefaultsMethod · 0.95
buildPayloadDataMethod · 0.80

Calls 2

GoTypeDefMethod · 0.95
GoTypeNameMethod · 0.95

Tested by

no test coverage detected