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

Function AsArray

expr/types.go:203–214  ·  view source on GitHub ↗

AsArray returns the type underlying array if any, nil otherwise.

(dt DataType)

Source from the content-addressed store, hash-verified

201
202// AsArray returns the type underlying array if any, nil otherwise.
203func AsArray(dt DataType) *Array {
204 switch t := dt.(type) {
205 case *UserTypeExpr:
206 return AsArray(t.Type)
207 case *ResultTypeExpr:
208 return AsArray(t.Type)
209 case *Array:
210 return t
211 default:
212 return nil
213 }
214}
215
216// AsMap returns the type underlying map if any, nil otherwise.
217func AsMap(dt DataType) *Map {

Callers 15

extractPathParamsMethod · 0.92
extractQueryParamsMethod · 0.92
extractHeadersMethod · 0.92
addMarshalTagsFunction · 0.92
paramForFunction · 0.92
itemsFromExprFunction · 0.92
headersFromExprFunction · 0.92
hashAttributeFunction · 0.92
transformAttributeFunction · 0.92
transformObjectFunction · 0.92
collectHelpersFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestAsArrayFunction · 0.68