From 0ebfa231d21b255d84cfdb8a618cfe397db6c497 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 15 Sep 2009 09:41:59 -0700 Subject: more "declared and not used". the last round omitted := range and only checked 1 out of N vars in a multi-var := R=r OCL=34624 CL=34638 --- src/pkg/strings/strings_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pkg/strings/strings_test.go') diff --git a/src/pkg/strings/strings_test.go b/src/pkg/strings/strings_test.go index 7925ae835..a01285e95 100644 --- a/src/pkg/strings/strings_test.go +++ b/src/pkg/strings/strings_test.go @@ -66,7 +66,7 @@ var lastIndexTests = []IndexTest { // Execute f on each test case. funcName should be the name of f; it's used // in failure reports. func runIndexTests(t *testing.T, f func(s, sep string) int, funcName string, testCases []IndexTest) { - for i,test := range testCases { + for _, test := range testCases { actual := f(test.s, test.sep); if actual != test.out { t.Errorf("%s(%q,%q) = %v; want %v", funcName, test.s, test.sep, actual, test.out); @@ -149,7 +149,7 @@ type StringTest struct { // Execute f on each test case. funcName should be the name of f; it's used // in failure reports. func runStringTests(t *testing.T, f func(string) string, funcName string, testCases []StringTest) { - for i, tc := range testCases { + for _, tc := range testCases { actual := f(tc.in); if actual != tc.out { t.Errorf("%s(%q) = %q; want %q", funcName, tc.in, actual, tc.out); @@ -237,8 +237,8 @@ func equal(m string, s1, s2 string, t *testing.T) bool { if i > len(e2) { break } - r1, w := utf8.DecodeRuneInString(c1); - r2, w := utf8.DecodeRuneInString(e2[i]); + r1, _ := utf8.DecodeRuneInString(c1); + r2, _ := utf8.DecodeRuneInString(e2[i]); if r1 != r2 { t.Errorf("%s diff at %d: U+%04X U+%04X", m, i, r1, r2) } -- cgit v1.2.3