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

Function AsMap

expr/types.go:217–228  ·  view source on GitHub ↗

AsMap returns the type underlying map if any, nil otherwise.

(dt DataType)

Source from the content-addressed store, hash-verified

215
216// AsMap returns the type underlying map if any, nil otherwise.
217func AsMap(dt DataType) *Map {
218 switch t := dt.(type) {
219 case *UserTypeExpr:
220 return AsMap(t.Type)
221 case *ResultTypeExpr:
222 return AsMap(t.Type)
223 case *Map:
224 return t
225 default:
226 return nil
227 }
228}
229
230// AsUnion returns the type underlying union if any, nil otherwise.
231func AsUnion(dt DataType) *Union {

Callers 15

mapQueryDecodeDataFunction · 0.92
buildPayloadDataMethod · 0.92
extractQueryParamsMethod · 0.92
addMarshalTagsFunction · 0.92
hashAttributeFunction · 0.92
transformAttributeFunction · 0.92
transformObjectFunction · 0.92
collectHelpersFunction · 0.92
extractMetadataFunction · 0.92
makeProtoBufMessageRFunction · 0.92
transformAttributeFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestAsMapFunction · 0.68