MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / jsonString

Method jsonString

pkg/sql/sem/tree/pretty.go:2493–2499  ·  view source on GitHub ↗

jsonString parses s as JSON and pretty prints it.

(s string)

Source from the content-addressed store, hash-verified

2491
2492// jsonString parses s as JSON and pretty prints it.
2493func (p *PrettyCfg) jsonString(s string) pretty.Doc {
2494 j, err := json.ParseJSON(s)
2495 if err != nil {
2496 return pretty.Text(s)
2497 }
2498 return p.bracket(`'`, p.jsonNode(j), `'`)
2499}
2500
2501// jsonNode pretty prints a JSON node.
2502func (p *PrettyCfg) jsonNode(j json.JSON) pretty.Doc {

Callers 1

jsonCastMethod · 0.95

Calls 4

bracketMethod · 0.95
jsonNodeMethod · 0.95
ParseJSONFunction · 0.92
TextFunction · 0.92

Tested by

no test coverage detected