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

Method IsPrimitivePointer

codegen/transformer.go:217–225  ·  view source on GitHub ↗

IsPrimitivePointer returns true if the attribute with the given name is a primitive pointer in the given parent attribute.

(name string, att *expr.AttributeExpr)

Source from the content-addressed store, hash-verified

215// IsPrimitivePointer returns true if the attribute with the given name is a
216// primitive pointer in the given parent attribute.
217func (a *AttributeContext) IsPrimitivePointer(name string, att *expr.AttributeExpr) bool {
218 if at := att.Find(name); at != nil && (at.Type == expr.Any || at.Type == expr.Bytes) {
219 return false
220 }
221 if a.Pointer {
222 return true
223 }
224 return att.IsPrimitivePointer(name, a.UseDefault)
225}
226
227// Pkg returns the package name of the given type.
228func (a *AttributeContext) Pkg(att *expr.AttributeExpr) string {

Callers 5

TestIsPrimitivePointerFunction · 0.45
transformObjectFunction · 0.45
BuildSchemeDataFunction · 0.45
collectAttributesFunction · 0.45

Calls 1

FindMethod · 0.80

Tested by 1

TestIsPrimitivePointerFunction · 0.36