mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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
This commit is contained in:
parent
1a3198907b
commit
ca6a0fee1b
95 changed files with 221 additions and 218 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue