MCPcopy Create free account
hub / github.com/apache/fory / getGoTypeString

Function getGoTypeString

go/fory/codegen/decoder.go:966–979  ·  view source on GitHub ↗

getGoTypeString returns the Go type string for a types.Type

(t types.Type)

Source from the content-addressed store, hash-verified

964
965// getGoTypeString returns the Go type string for a types.Type
966func getGoTypeString(t types.Type) string {
967 // Handle basic types
968 if basic, ok := t.Underlying().(*types.Basic); ok {
969 switch basic.Kind() {
970 case types.Int:
971 return "int"
972 case types.String:
973 return "string"
974 default:
975 return t.String()
976 }
977 }
978 return t.String()
979}
980
981// generateMapKeyRead generates code to read a map key
982// Uses error-aware methods for deferred error checking

Callers 1

writeMapReadChunksFunction · 0.85

Calls 2

KindMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected