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

Method IsRequiredNoDefault

expr/attribute.go:454–461  ·  view source on GitHub ↗

IsRequiredNoDefault returns true if the given string matches the name of a required attribute and the attribute has no default value, false otherwise. This method only applies to attributes of type Object.

(attName string)

Source from the content-addressed store, hash-verified

452// required attribute and the attribute has no default value, false otherwise.
453// This method only applies to attributes of type Object.
454func (a *AttributeExpr) IsRequiredNoDefault(attName string) bool {
455 for _, name := range a.AllRequired() {
456 if name == attName {
457 return a.GetDefault(name) == nil
458 }
459 }
460 return false
461}
462
463// IsPrimitivePointer returns true if the field generated for the given
464// attribute should be a pointer to a primitive type. The receiver attribute must

Callers 4

paramsFromHeadersFunction · 0.80
headersFromAttrFunction · 0.80

Calls 2

AllRequiredMethod · 0.95
GetDefaultMethod · 0.95

Tested by 1