MCPcopy Create free account
hub / github.com/google/go-github / exprToString

Function exprToString

tools/structfield/structfield.go:346–357  ·  view source on GitHub ↗
(e ast.Expr)

Source from the content-addressed store, hash-verified

344}
345
346func exprToString(e ast.Expr) string {
347 switch t := e.(type) {
348 case *ast.Ident:
349 return t.Name
350 case *ast.SelectorExpr:
351 return exprToString(t.X) + "." + t.Sel.Name
352 case *ast.MapType:
353 return "map[" + exprToString(t.Key) + "]" + exprToString(t.Value)
354 default:
355 return fmt.Sprintf("%T", e)
356 }
357}
358
359func splitTag(jsonTagName string) []string {
360 jsonTagName = strings.TrimPrefix(jsonTagName, "$")

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…