typeNameWithParams returns the type name with generic parameters appended if they exist stripTypeParams removes type parameters from a type name for lookup purposes e.g. "MyType[T, U]" becomes "MyType", "*SomeType[A]" becomes "*SomeType"
(typeName string)
| 179 | // stripTypeParams removes type parameters from a type name for lookup purposes |
| 180 | // e.g. "MyType[T, U]" becomes "MyType", "*SomeType[A]" becomes "*SomeType" |
| 181 | func stripTypeParams(typeName string) string { |
| 182 | if idx := strings.Index(typeName, "["); idx != -1 { |
| 183 | return typeName[:idx] |
| 184 | } |
| 185 | return typeName |
| 186 | } |
| 187 | |
| 188 | func (c *common) typeNameWithParams(baseName string) string { |
| 189 | if c.typeParams.TypeParams != "" && !strings.Contains(baseName, "[") { |