Skip to content

Commit

Permalink
feat(MarshalJSON): marshals slice of SubDiff.diffs to JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
ramfox committed Mar 1, 2018
1 parent fd9745b commit 54dc77e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datasetDiffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ type SubDiff struct {
a, b []byte
}

// MarshalJSON marshals the slice of diffs from the SubDiff
func (d *SubDiff) MarshalJSON() ([]byte, error) {
return json.Marshal(d.Diff.Deltas())
}

// SummarizeToString outputs a substring in a one of a few formats
// - simple (single line describing which component and how many
// changes)
Expand Down

0 comments on commit 54dc77e

Please sign in to comment.