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

Function unalias

codegen/funcs.go:346–354  ·  view source on GitHub ↗

Get the underlying primitive type of a aliased type or return the type itself if not aliased.

(dt expr.DataType)

Source from the content-addressed store, hash-verified

344// Get the underlying primitive type of a aliased type or return the type itself
345// if not aliased.
346func unalias(dt expr.DataType) expr.DataType {
347 if ut, ok := dt.(expr.UserType); ok {
348 if _, ok := ut.Attribute().Type.(expr.Primitive); ok {
349 return ut.Attribute().Type
350 }
351 return unalias(ut.Attribute().Type)
352 }
353 return dt
354}
355
356func runeSpacePosRev(r []rune) int {
357 for i := len(r) - 1; i > 0; i-- {

Callers 2

InitStructFieldsFunction · 0.70
validationCodeFunction · 0.70

Calls 1

AttributeMethod · 0.65

Tested by

no test coverage detected