Skip to content

Commit 65d71bb

Browse files
authored
Merge pull request #87 from justinsb/spew_no_more
Replace go-spew with go-cmp
2 parents d865f09 + 13f0a74 commit 65d71bb

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module sigs.k8s.io/yaml
33
go 1.12
44

55
require (
6-
github.com/davecgh/go-spew v1.1.1
6+
github.com/google/go-cmp v0.5.9
77
gopkg.in/yaml.v2 v2.4.0
88
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2-
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1+
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
2+
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
33
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
44
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
55
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

yaml_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"strconv"
2626
"testing"
2727

28-
"github.com/davecgh/go-spew/spew"
28+
"github.com/google/go-cmp/cmp"
2929
yaml "gopkg.in/yaml.v2"
3030
)
3131

@@ -832,8 +832,8 @@ func TestJSONObjectToYAMLObject(t *testing.T) {
832832
got := JSONObjectToYAMLObject(tt.input)
833833
sortMapSlicesInPlace(tt.expected)
834834
sortMapSlicesInPlace(got)
835-
if !reflect.DeepEqual(got, tt.expected) {
836-
t.Errorf("jsonToYAML() = %v, want %v", spew.Sdump(got), spew.Sdump(tt.expected))
835+
if !reflect.DeepEqual(tt.expected, got) {
836+
t.Errorf("jsonToYAML() returned unexpected results (-want+got):\n%v", cmp.Diff(tt.expected, got))
837837
}
838838

839839
jsonBytes, err := json.Marshal(tt.input)
@@ -872,7 +872,8 @@ func TestJSONObjectToYAMLObject(t *testing.T) {
872872
}
873873

874874
if !reflect.DeepEqual(got, gotByRoundtrip) {
875-
t.Errorf("yaml.Unmarshal(json.Marshal(tt.input)) = %v, want %v\njson: %s", spew.Sdump(gotByRoundtrip), spew.Sdump(got), string(jsonBytes))
875+
t.Errorf("yaml.Unmarshal(json.Marshal(tt.input)) returned unexpected results (-want+got):\n%v", cmp.Diff(got, gotByRoundtrip))
876+
t.Errorf("json: %s", string(jsonBytes))
876877
}
877878
})
878879
}

0 commit comments

Comments
 (0)