1package seq 2 3import "fmt" 4 5type Result struct { 6 Issues []Issue 7} 8 9type Issue struct { 10 Path string 11 ExpectedValue string 12 ActualValue string 13} 14 15func (r *Result) Ok() bool { 16 return len(r.Issues) == 0 17} 18 19func (d *Issue) String() string { 20 return fmt.Sprintf("Expected '%s' to be '%v' but got '%s'", 21 d.Path, 22 d.ExpectedValue, 23 d.ActualValue, 24 ) 25} 26 27func NewResult() *Result { 28 return &Result{} 29} 30 31func (r *Result) AddIssue(key, expected, actual string) { 32 r.Issues = append(r.Issues, Issue{key, expected, actual}) 33} 34