getGoTypeString returns the Go type string for a types.Type
(t types.Type)
| 964 | |
| 965 | // getGoTypeString returns the Go type string for a types.Type |
| 966 | func 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 |
no test coverage detected