jsonCast attempts to pretty print a string that is cast or asserted as JSON.
(sv *StrVal, op string, typ *types.T)
| 2482 | |
| 2483 | // jsonCast attempts to pretty print a string that is cast or asserted as JSON. |
| 2484 | func (p *PrettyCfg) jsonCast(sv *StrVal, op string, typ *types.T) pretty.Doc { |
| 2485 | return pretty.Fold(pretty.Concat, |
| 2486 | p.jsonString(sv.RawString()), |
| 2487 | pretty.Text(op), |
| 2488 | p.formatType(typ), |
| 2489 | ) |
| 2490 | } |
| 2491 | |
| 2492 | // jsonString parses s as JSON and pretty prints it. |
| 2493 | func (p *PrettyCfg) jsonString(s string) pretty.Doc { |
no test coverage detected