diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-03-01 14:55:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-01 14:55:03 +0800 |
commit | f04b2d43509816ecfda93aa5d0d1fd685d9b860f (patch) | |
tree | 548c7b0b4ff2f187569e74cf99c19742a44f18aa /internal/db/git_diff_test.go | |
parent | 9c65798902386341a205d52b6b3842e1dc2c751a (diff) |
lint: fix some Golang CI lint issues (#5955)
Diffstat (limited to 'internal/db/git_diff_test.go')
-rw-r--r-- | internal/db/git_diff_test.go | 26 |
1 files changed, 10 insertions, 16 deletions
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 <span class=\"added-code\">bar</span> 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 <span class=\"removed-code\">bar</span> 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)) } |