diff options
| author | Russ Cox <rsc@golang.org> | 2009-09-15 09:41:59 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-09-15 09:41:59 -0700 |
| commit | ca6a0fee1b3f68ab4e9f8e1c7fbe80f178e68c09 (patch) | |
| tree | 46eac6aefe26f0b9056bff646d960bcba3d076cf /src/pkg/strings/strings_test.go | |
| parent | 1a3198907bf18ac961762024cf2a27581e6be6c3 (diff) | |
| download | go-ca6a0fee1b3f68ab4e9f8e1c7fbe80f178e68c09.tar.xz | |
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
Diffstat (limited to 'src/pkg/strings/strings_test.go')
| -rw-r--r-- | src/pkg/strings/strings_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/strings/strings_test.go b/src/pkg/strings/strings_test.go index 7925ae8352..a01285e95b 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) } |
