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

Function IsPrimitive

expr/types.go:257–268  ·  view source on GitHub ↗

IsPrimitive returns true if the data type is a primitive type.

(dt DataType)

Source from the content-addressed store, hash-verified

255
256// IsPrimitive returns true if the data type is a primitive type.
257func IsPrimitive(dt DataType) bool {
258 switch t := dt.(type) {
259 case Primitive:
260 return true
261 case *UserTypeExpr:
262 return IsPrimitive(t.Type)
263 case *ResultTypeExpr:
264 return IsPrimitive(t.Type)
265 default:
266 return false
267 }
268}
269
270// IsAlias returns true if the data type is a user type backed by a primitive
271// type (so call aliased type).

Callers 15

goTypeDefFunction · 0.92
buildPayloadDataMethod · 0.92
buildRequestBodyTypeMethod · 0.92
buildResponseBodyTypeMethod · 0.92
transformObjectFunction · 0.92
collectMessagesFunction · 0.92
collectValidationsRFunction · 0.92
makeProtoBufMessageFunction · 0.92
makeProtoBufMessageRFunction · 0.92
protoBufMessageDefFunction · 0.92
InitStructFieldsFunction · 0.92
transformObjectFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestIsPrimitiveFunction · 0.68