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

Function flagType

codegen/cli/cli.go:422–431  ·  view source on GitHub ↗

flagType calculates the type of a flag

(tname string)

Source from the content-addressed store, hash-verified

420
421// flagType calculates the type of a flag
422func flagType(tname string) string {
423 switch tname {
424 case boolN, intN, int32N, int64N, uintN, uint32N, uint64N, float32N, float64N, stringN:
425 return strings.ToUpper(tname)
426 case bytesN:
427 return "STRING"
428 default: // Any, Array, Map, Object, User
429 return "JSON"
430 }
431}
432
433// jsonExample generates a json example
434func jsonExample(v any) string {

Callers 4

BuildSubcommandDataFunction · 0.85
NewFlagDataFunction · 0.85
FieldLoadCodeFunction · 0.85
conversionCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected