MarshalIndent is documented at https://golang.org/pkg/encoding/json/#MarshalIndent
(x any, prefix, indent string)
| 285 | |
| 286 | // MarshalIndent is documented at https://golang.org/pkg/encoding/json/#MarshalIndent |
| 287 | func MarshalIndent(x any, prefix, indent string) ([]byte, error) { |
| 288 | b, err := Marshal(x) |
| 289 | |
| 290 | if err == nil { |
| 291 | tmp := &bytes.Buffer{} |
| 292 | tmp.Grow(2 * len(b)) |
| 293 | |
| 294 | Indent(tmp, b, prefix, indent) |
| 295 | b = tmp.Bytes() |
| 296 | } |
| 297 | |
| 298 | return b, err |
| 299 | } |
| 300 | |
| 301 | // Unmarshal is documented at https://golang.org/pkg/encoding/json/#Unmarshal |
| 302 | func Unmarshal(b []byte, x any) error { |
searching dependent graphs…