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

Method GoTypeRefWithDefaults

codegen/scope.go:265–268  ·  view source on GitHub ↗

GoTypeRefWithDefaults returns the Go code that refers to the Go type which matches the given attribute type. The result of this function differs from GoTypeRef when the attribute type is an object (note: not a user type) and the reference is thus an inline struct definition. In this case accounting

(att *expr.AttributeExpr)

Source from the content-addressed store, hash-verified

263// the reference is thus an inline struct definition. In this case accounting
264// for default values may cause child attributes to use non-pointer fields.
265func (s *NameScope) GoTypeRefWithDefaults(att *expr.AttributeExpr) string {
266 name := s.GoTypeNameWithDefaults(att)
267 return goTypeRef(name, att.Type)
268}
269
270// GoFullTypeRef returns the Go code that refers to the Go type which matches
271// the given attribute type defined in the given package if a user type.

Callers 1

buildPayloadDataMethod · 0.80

Calls 2

goTypeRefFunction · 0.85

Tested by

no test coverage detected