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

Function isPrimitive

codegen/service/convert.go:896–929  ·  view source on GitHub ↗

isPrimitive is true if the given kind matches a goa primitive type.

(t reflect.Type)

Source from the content-addressed store, hash-verified

894
895// isPrimitive is true if the given kind matches a goa primitive type.
896func isPrimitive(t reflect.Type) bool {
897 switch t.Kind() {
898 case reflect.Bool:
899 fallthrough
900 case reflect.Int:
901 fallthrough
902 case reflect.Int32:
903 fallthrough
904 case reflect.Int64:
905 fallthrough
906 case reflect.Uint:
907 fallthrough
908 case reflect.Uint32:
909 fallthrough
910 case reflect.Uint64:
911 fallthrough
912 case reflect.Float32:
913 fallthrough
914 case reflect.Float64:
915 fallthrough
916 case reflect.Interface:
917 fallthrough
918 case reflect.String:
919 return true
920 case reflect.Slice:
921 e := t.Elem()
922 if e.Kind() == reflect.Uint8 {
923 return true
924 }
925 return false
926 default:
927 return false
928 }
929}
930
931type compRec struct {
932 path string

Callers 2

buildDesignTypeFunction · 0.85
compatibleFunction · 0.85

Calls 1

KindMethod · 0.65

Tested by

no test coverage detected