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

Method Set

expr/types.go:473–481  ·  view source on GitHub ↗

Set replaces the object named attribute n if any - creates a new object by appending to the slice of named attributes otherwise. The resulting object is returned in both cases.

(n string, att *AttributeExpr)

Source from the content-addressed store, hash-verified

471// appending to the slice of named attributes otherwise. The resulting object is
472// returned in both cases.
473func (o *Object) Set(n string, att *AttributeExpr) {
474 for _, nat := range *o {
475 if nat.Name == n {
476 nat.Attribute = att
477 return
478 }
479 }
480 *o = append(*o, &NamedAttributeExpr{n, att})
481}
482
483// Delete creates a new object with the same named attributes as o but without
484// the named attribute n if any.

Callers 15

ValidateMethod · 0.95
validateMessageFunction · 0.95
PathParamsMethod · 0.95
QueryParamsMethod · 0.95
DupTypeMethod · 0.95
buildTypeInitsFunction · 0.95
buildProjectionsFunction · 0.95
buildValidationsFunction · 0.95
buildConstructorCodeFunction · 0.95
FinalizeMethod · 0.80
FinalizeMethod · 0.80
mapUnmappedAttrsMethod · 0.80

Calls

no outgoing calls

Tested by 13

TestRequestEncoderFunction · 0.64
TestRequestDecoderFunction · 0.64
TestMiddlewareFunction · 0.64
TestRequestIDFunction · 0.64
ServeHTTPMethod · 0.64
TestMiddlewareFunction · 0.64
TestTransportFunction · 0.64
TestRecordRequestFunction · 0.64
TestUnaryServerTraceFunction · 0.64
TestStreamServerTraceFunction · 0.64