(w io.Writer)
| 61 | } |
| 62 | |
| 63 | func (d Dump) WriteJSON(w io.Writer) error { |
| 64 | enc := json.NewEncoder(w) |
| 65 | enc.SetIndent("", " ") |
| 66 | if err := enc.Encode(d); err != nil { |
| 67 | return fmt.Errorf("encode dump: %w", err) |
| 68 | } |
| 69 | return nil |
| 70 | } |
| 71 | |
| 72 | // ReadJSON parses a Dump and rejects any version this build can't interpret — a silent misparse of an |
| 73 | // unrecognized schema is worse than a clear error. |