Skip to content

Commit

Permalink
Bump golangci-lint to v1.60, fix new warnings
Browse files Browse the repository at this point in the history
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 <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Aug 14, 2024
1 parent a178aad commit 5349b59
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
sudo apt -qy install libseccomp-dev
- uses: golangci/golangci-lint-action@v6
with:
version: v1.59
version: v1.60
# Extra linters, only checking new code from a pull request.
- name: lint-extra
if: github.event_name == 'pull_request'
Expand Down
5 changes: 2 additions & 3 deletions libcontainer/cgroups/fs/blkio_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package fs

import (
"fmt"
"strconv"
"testing"

Expand Down Expand Up @@ -478,7 +477,7 @@ func TestBlkioStatsNoFilesBFQDebug(t *testing.T) {
actualStats := *cgroups.NewStats()
err := cpuset.GetStats(path, &actualStats)
if err != nil {
t.Errorf(fmt.Sprintf("test case '%s' failed unexpectedly: %s", testCase.desc, err))
t.Errorf("%s: want no error, got: %+v", testCase.desc, err)
}
}
}
Expand Down Expand Up @@ -592,7 +591,7 @@ func TestBlkioStatsNoFilesCFQ(t *testing.T) {
actualStats := *cgroups.NewStats()
err := cpuset.GetStats(path, &actualStats)
if err != nil {
t.Errorf(fmt.Sprintf("test case '%s' failed unexpectedly: %s", testCase.desc, err))
t.Errorf("%s: want no error, got %+v", testCase.desc, err)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/configs/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ exit 0
})

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

Expand Down

0 comments on commit 5349b59

Please sign in to comment.