| 852 | } |
| 853 | |
| 854 | func formatSpecifierImpl(td *TypeDesc, sb *strings.Builder) { |
| 855 | if td.IsTypeParam { |
| 856 | sb.WriteRune('~') |
| 857 | sb.WriteString(td.TypeName) |
| 858 | return |
| 859 | } |
| 860 | sb.WriteString(td.TypeName) |
| 861 | l := len(td.Params) |
| 862 | if l < 1 { |
| 863 | return |
| 864 | } |
| 865 | sb.WriteRune('<') |
| 866 | for i, p := range td.Params { |
| 867 | formatSpecifierImpl(p, sb) |
| 868 | if i < l-1 { |
| 869 | sb.WriteString(", ") |
| 870 | } |
| 871 | } |
| 872 | sb.WriteRune('>') |
| 873 | } |
| 874 | |
| 875 | // SpecifierFormat returns the short text representation of the type. e.g. "map<string, int>" |
| 876 | func (td *TypeDesc) SpecifierFormat() string { |