Skip to content

Commit 1fdd5af

Browse files
vicky-sunshinemarkya0616
authored andcommitted
cmd: fix tests with nicediff function and avoid non-constant format string in call to (*testing.common).Logf
1 parent 7538260 commit 1fdd5af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/geth/logging_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func testConsoleLogging(t *testing.T, format string, tStart, tEnd int) {
9191
have = censor(have, tStart, tEnd)
9292
want = censor(want, tStart, tEnd)
9393
if have != want {
94-
t.Logf(nicediff([]byte(have), []byte(want)))
94+
t.Logf("%s", nicediff([]byte(have), []byte(want)))
9595
t.Fatalf("format %v, line %d\nhave %v\nwant %v", format, i, have, want)
9696
}
9797
}
@@ -142,7 +142,7 @@ func TestJsonLogging(t *testing.T) {
142142
}
143143
if !bytes.Equal(have, want) {
144144
// show an intelligent diff
145-
t.Logf(nicediff(have, want))
145+
t.Logf("%s", nicediff(have, want))
146146
t.Errorf("file content wrong")
147147
}
148148
}
@@ -211,7 +211,7 @@ func TestFileOut(t *testing.T) {
211211
}
212212
if !bytes.Equal(have, want) {
213213
// show an intelligent diff
214-
t.Logf(nicediff(have, want))
214+
t.Logf("%s", nicediff(have, want))
215215
t.Errorf("file content wrong")
216216
}
217217
}
@@ -231,7 +231,7 @@ func TestRotatingFileOut(t *testing.T) {
231231
}
232232
if !bytes.Equal(have, want) {
233233
// show an intelligent diff
234-
t.Logf(nicediff(have, want))
234+
t.Logf("%s", nicediff(have, want))
235235
t.Errorf("file content wrong")
236236
}
237237
}

0 commit comments

Comments
 (0)