MCPcopy
hub / github.com/tinylib/msgp / stripTypeParams

Function stripTypeParams

gen/elem.go:181–186  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 5

gBaseMethod · 0.85
gBaseMethod · 0.85
gBaseMethod · 0.85
gBaseMethod · 0.85
gBaseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…