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

Method Map

expr/mapped_attribute.go:115–121  ·  view source on GitHub ↗

Map records the element name of one of the child attributes. Map panics if attName is not the name of a child attribute.

(elemName, attName string)

Source from the content-addressed store, hash-verified

113// Map records the element name of one of the child attributes.
114// Map panics if attName is not the name of a child attribute.
115func (ma *MappedAttributeExpr) Map(elemName, attName string) {
116 if att := AsObject(ma.Type).Attribute(attName); att == nil {
117 panic(attName + " is not the name of a child of the mapped attribute") // bug
118 }
119 ma.nameMap[attName] = elemName
120 ma.reverseMap[elemName] = attName
121}
122
123// Delete removes a child attribute given its name.
124func (ma *MappedAttributeExpr) Delete(attName string) {

Callers 3

FinalizeMethod · 0.80
mapUnmappedAttrsMethod · 0.80
FinalizeMethod · 0.80

Calls 2

AsObjectFunction · 0.85
AttributeMethod · 0.65

Tested by

no test coverage detected