From f04b2d43509816ecfda93aa5d0d1fd685d9b860f Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sun, 1 Mar 2020 14:55:03 +0800 Subject: lint: fix some Golang CI lint issues (#5955) --- internal/db/git_diff_test.go | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'internal/db/git_diff_test.go') diff --git a/internal/db/git_diff_test.go b/internal/db/git_diff_test.go index d92afe9e..697e8dc7 100644 --- a/internal/db/git_diff_test.go +++ b/internal/db/git_diff_test.go @@ -18,24 +18,18 @@ func assertEqual(t *testing.T, s1 string, s2 template.HTML) { } } -func assertLineEqual(t *testing.T, d1 *git.DiffLine, d2 *git.DiffLine) { - if d1 != d2 { - t.Errorf("%v should be equal %v", d1, d2) - } -} - func Test_diffToHTML(t *testing.T) { assertEqual(t, "+foo bar biz", diffToHTML([]dmp.Diff{ - dmp.Diff{dmp.DiffEqual, "foo "}, - dmp.Diff{dmp.DiffInsert, "bar"}, - dmp.Diff{dmp.DiffDelete, " baz"}, - dmp.Diff{dmp.DiffEqual, " biz"}, - }, git.DIFF_LINE_ADD)) + {Type: dmp.DiffEqual, Text: "foo "}, + {Type: dmp.DiffInsert, Text: "bar"}, + {Type: dmp.DiffDelete, Text: " baz"}, + {Type: dmp.DiffEqual, Text: " biz"}, + }, git.DiffLineAdd)) assertEqual(t, "-foo bar biz", diffToHTML([]dmp.Diff{ - dmp.Diff{dmp.DiffEqual, "foo "}, - dmp.Diff{dmp.DiffDelete, "bar"}, - dmp.Diff{dmp.DiffInsert, " baz"}, - dmp.Diff{dmp.DiffEqual, " biz"}, - }, git.DIFF_LINE_DEL)) + {Type: dmp.DiffEqual, Text: "foo "}, + {Type: dmp.DiffDelete, Text: "bar"}, + {Type: dmp.DiffInsert, Text: " baz"}, + {Type: dmp.DiffEqual, Text: " biz"}, + }, git.DiffLineDel)) } -- cgit v1.2.3