WriteJSON encodes v as indented JSON to w.
(w io.Writer, v any)
| 12 | |
| 13 | // WriteJSON encodes v as indented JSON to w. |
| 14 | func WriteJSON(w io.Writer, v any) error { |
| 15 | enc := json.NewEncoder(w) |
| 16 | enc.SetIndent("", " ") |
| 17 | return enc.Encode(v) |
| 18 | } |
| 19 | |
| 20 | // WriteYAML encodes v as YAML to w. |
| 21 | func WriteYAML(w io.Writer, v any) error { |
no outgoing calls