Skip to content

Commit 41cb09f

Browse files
committed
Use t.Errorf instead of t.Error+fmt.Sprintf
1 parent 8d29b8c commit 41cb09f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

encoder_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestEncodeSinglefileTorrentBencode(t *testing.T) {
5050
res := string(Encode(dict))
5151
expected := "d8:announce41:http://bttracker.debian.org:6969/announce7:comment35:\"Debian CD from cdimage.debian.org\"13:creation datei1391870037e9:httpseedsl85:http://cdimage.debian.org/cdimage/release/7.4.0/iso-cd/debian-7.4.0-amd64-netinst.iso85:http://cdimage.debian.org/cdimage/archive/7.4.0/iso-cd/debian-7.4.0-amd64-netinst.isoe4:infod6:lengthi232783872e4:name30:debian-7.4.0-amd64-netinst.iso12:piece lengthi262144e6:pieces0:ee"
5252
if res != expected {
53-
t.Error(fmt.Sprintf("expected %s\ngot %s", expected, res))
53+
t.Errorf("expected %s\ngot %s", expected, res)
5454
}
5555
}
5656

@@ -85,7 +85,7 @@ func TestEncodeListOfInts(t *testing.T) {
8585
expected += "i1e"
8686
expected += "ee"
8787
if res != expected {
88-
t.Error(fmt.Sprintf("expected %s\ngot %s", expected, res))
88+
t.Errorf("expected %s\ngot %s", expected, res)
8989
}
9090
}
9191

0 commit comments

Comments
 (0)