From 41cb09f6438e94cd715245fed9b2666d5e644255 Mon Sep 17 00:00:00 2001 From: Mark Samman Date: Tue, 13 Jan 2015 02:00:46 +0100 Subject: [PATCH] Use t.Errorf instead of t.Error+fmt.Sprintf --- encoder_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/encoder_test.go b/encoder_test.go index 4b81f29..3dc1c06 100644 --- a/encoder_test.go +++ b/encoder_test.go @@ -50,7 +50,7 @@ func TestEncodeSinglefileTorrentBencode(t *testing.T) { res := string(Encode(dict)) 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" if res != expected { - t.Error(fmt.Sprintf("expected %s\ngot %s", expected, res)) + t.Errorf("expected %s\ngot %s", expected, res) } } @@ -85,7 +85,7 @@ func TestEncodeListOfInts(t *testing.T) { expected += "i1e" expected += "ee" if res != expected { - t.Error(fmt.Sprintf("expected %s\ngot %s", expected, res)) + t.Errorf("expected %s\ngot %s", expected, res) } }