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

Function DupMappedAtt

expr/mapped_attribute.go:87–97  ·  view source on GitHub ↗

DupMappedAtt creates a deep copy of ma.

(ma *MappedAttributeExpr)

Source from the content-addressed store, hash-verified

85
86// DupMappedAtt creates a deep copy of ma.
87func DupMappedAtt(ma *MappedAttributeExpr) *MappedAttributeExpr {
88 nameMap := make(map[string]string, len(ma.nameMap))
89 reverseMap := make(map[string]string, len(ma.reverseMap))
90 maps.Copy(nameMap, ma.nameMap)
91 maps.Copy(reverseMap, ma.reverseMap)
92 return &MappedAttributeExpr{
93 AttributeExpr: DupAtt(ma.AttributeExpr),
94 nameMap: nameMap,
95 reverseMap: reverseMap,
96 }
97}
98
99// WalkMappedAttr iterates over the mapped attributes. It calls the given
100// function giving each attribute as it iterates. WalkMappedAttr stops if there

Callers 3

DupMethod · 0.85
validateParamsMethod · 0.85

Calls 1

DupAttFunction · 0.85

Tested by

no test coverage detected