Skip to content

Commit 20ebb0f

Browse files
committed
get rid of all module deps
sergi/go-diff is only used in one test, though having it as a module dependency is still noteworthy. That will become less of a problem once lazy module loading is widespread, but that's still at least one year away. Plus, we only used go-diff for a simple use case: to show a diff for a failed diff test. We already print the got/want text, so a diff is strictly speaking not necessary. Plus, if printing the entire text is reasonable, it's not like the diff would matter in terms of printing less text. While at it, bump the go language version from 1.13 to 1.15, since Go 1.14.x and older are no longer maintained. Fixes #23.
1 parent 5b29258 commit 20ebb0f

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

go.mod

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
module github.com/pkg/diff
22

3-
go 1.13
4-
5-
require (
6-
github.com/sergi/go-diff v1.0.0
7-
github.com/stretchr/testify v1.4.0 // indirect
8-
)
3+
go 1.15

go.sum

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +0,0 @@
1-
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
2-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3-
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4-
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5-
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
6-
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
7-
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
8-
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
9-
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
10-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
11-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
12-
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
13-
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

write/unified_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/pkg/diff/ctxt"
1111
"github.com/pkg/diff/myers"
1212
"github.com/pkg/diff/write"
13-
"github.com/sergi/go-diff/diffmatchpatch"
1413
)
1514

1615
var goldenTests = []struct {
@@ -94,12 +93,9 @@ func TestGolden(t *testing.T) {
9493
if test.want != got {
9594
t.Logf("%q\n", test.want)
9695
t.Logf("%q\n", got)
97-
dmp := diffmatchpatch.New()
98-
delta := dmp.DiffMain(test.want, got, false)
99-
t.Errorf("bad diff: a=%q b=%q\n\ngot:\n%s\nwant:\n%s\ndiff:\n%s\n",
96+
t.Errorf("bad diff: a=%q b=%q\n\ngot:\n%s\nwant:\n%s",
10097
test.a, test.b,
10198
got, test.want,
102-
dmp.DiffPrettyText(delta),
10399
)
104100
}
105101
})

0 commit comments

Comments
 (0)