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

Function ToString

http/codegen/openapi/json_schema.go:415–428  ·  view source on GitHub ↗

ToString returns the string representation of the given type.

(val any)

Source from the content-addressed store, hash-verified

413
414// ToString returns the string representation of the given type.
415func ToString(val any) string {
416 switch actual := val.(type) {
417 case string:
418 return actual
419 case int:
420 return strconv.Itoa(actual)
421 case float64:
422 return strconv.FormatFloat(actual, 'f', -1, 64)
423 case bool:
424 return strconv.FormatBool(actual)
425 default:
426 panic("unexpected key type")
427 }
428}
429
430// ToStringMap converts map[any]any to a map[string]any
431// when possible.

Callers 1

ToStringMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected