Skip to content

Commit 606257c

Browse files
kolyshkinlifubang
authored andcommitted
Bump golangci-lint to v1.60, fix new warnings
The warnings fixed were: libcontainer/configs/config_test.go:205:12: printf: non-constant format string in call to (*testing.common).Errorf (govet) t.Errorf(fmt.Sprintf("Expected error to not occur but it was %+v", err)) ^ libcontainer/cgroups/fs/blkio_test.go:481:13: printf: non-constant format string in call to (*testing.common).Errorf (govet) t.Errorf(fmt.Sprintf("test case '%s' failed unexpectedly: %s", testCase.desc, err)) ^ libcontainer/cgroups/fs/blkio_test.go:595:13: printf: non-constant format string in call to (*testing.common).Errorf (govet) t.Errorf(fmt.Sprintf("test case '%s' failed unexpectedly: %s", testCase.desc, err)) ^ Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent adedeb9 commit 606257c

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
sudo apt -qy install libseccomp-dev
4141
- uses: golangci/golangci-lint-action@v6
4242
with:
43-
version: v1.59
43+
version: v1.60
4444
# Extra linters, only checking new code from a pull request.
4545
- name: lint-extra
4646
if: github.event_name == 'pull_request'

libcontainer/cgroups/fs/blkio_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package fs
22

33
import (
4-
"fmt"
54
"strconv"
65
"testing"
76

@@ -478,7 +477,7 @@ func TestBlkioStatsNoFilesBFQDebug(t *testing.T) {
478477
actualStats := *cgroups.NewStats()
479478
err := cpuset.GetStats(path, &actualStats)
480479
if err != nil {
481-
t.Errorf(fmt.Sprintf("test case '%s' failed unexpectedly: %s", testCase.desc, err))
480+
t.Errorf("%s: want no error, got: %+v", testCase.desc, err)
482481
}
483482
}
484483
}
@@ -592,7 +591,7 @@ func TestBlkioStatsNoFilesCFQ(t *testing.T) {
592591
actualStats := *cgroups.NewStats()
593592
err := cpuset.GetStats(path, &actualStats)
594593
if err != nil {
595-
t.Errorf(fmt.Sprintf("test case '%s' failed unexpectedly: %s", testCase.desc, err))
594+
t.Errorf("%s: want no error, got %+v", testCase.desc, err)
596595
}
597596
}
598597
}

libcontainer/configs/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ exit 0
202202
})
203203

204204
if err := cmdHook.Run(state); err != nil {
205-
t.Errorf(fmt.Sprintf("Expected error to not occur but it was %+v", err))
205+
t.Errorf("Want no error, got: %+v", err)
206206
}
207207
}
208208

0 commit comments

Comments
 (0)