Skip to content

Commit

Permalink
Merge pull request #581 from Desiki-high/chore-golangci-lint-action-v4
Browse files Browse the repository at this point in the history
chore: bump golangci-lint-action v4
  • Loading branch information
imeoer authored Feb 20, 2024
2 parents 8dbd486 + 730b88b commit 3e5ad7f
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: v1.55.2
version: v1.56.1
skip-cache: true
- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-nydus-grpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
Version: version.Version,
Flags: flags.F,
HideVersion: true,
Action: func(c *cli.Context) error {
Action: func(_ *cli.Context) error {
if flags.Args.PrintVersion {
fmt.Println("Version: ", version.Version)
fmt.Println("Revision: ", version.Revision)
Expand Down
2 changes: 1 addition & 1 deletion cmd/optimizer-nri-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func main() {
Version: version.Version,
Flags: flags.F,
HideVersion: true,
Action: func(c *cli.Context) error {
Action: func(_ *cli.Context) error {
var (
opts []stub.Option
err error
Expand Down
2 changes: 1 addition & 1 deletion cmd/prefetchfiles-nri-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func main() {
Version: version.Version,
Flags: flags.Flag,
HideVersion: true,
Action: func(c *cli.Context) error {
Action: func(_ *cli.Context) error {
var (
opts []stub.Option
err error
Expand Down
2 changes: 1 addition & 1 deletion internal/logging/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (

func GetRotateLogFileNumbers(testLogDir string, suffix string) int {
i := 0
err := filepath.Walk(testLogDir, func(fname string, fi os.FileInfo, err error) error {
err := filepath.Walk(testLogDir, func(fname string, fi os.FileInfo, _ error) error {
if !fi.IsDir() && strings.HasSuffix(fname, suffix) {
i++
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/kubesecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (kubelistener *KubeSecretListener) SyncKubeSecrets(ctx context.Context, cli
return
}
},
UpdateFunc: func(old, new interface{}) {
UpdateFunc: func(_, new interface{}) {
key, err := cache.MetaNamespaceKeyFunc(new)
if err != nil {
logrus.WithError(err).Errorf("failed to get key for secret from cache")
Expand Down
2 changes: 1 addition & 1 deletion pkg/converter/convert_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func unpackOciTar(ctx context.Context, dst string, reader io.Reader) error {
ctx,
dst,
ds,
archive.WithConvertWhiteout(func(hdr *tar.Header, file string) (bool, error) {
archive.WithConvertWhiteout(func(_ *tar.Header, _ string) (bool, error) {
// Keep to extract all whiteout files.
return true, nil
}),
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func prepareNydusServer(t *testing.T) (string, func()) {
if err == nil {
_ = os.Remove(mockSocket)
}
ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(200)
info := types.DaemonInfo{
ID: "testid",
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func New(keyChain *auth.PassKeyChain, insecure bool) *Remote {
),
),
docker.WithClient(newClient(insecure)),
docker.WithPlainHTTP(func(host string) (bool, error) {
docker.WithPlainHTTP(func(_ string) (bool, error) {
return plainHTTP, nil
}),
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (sc *Controller) getBackend() func(w http.ResponseWriter, r *http.Request)
}

func (sc *Controller) setPrefetchConfiguration() func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
return func(_ http.ResponseWriter, r *http.Request) {
body, err := io.ReadAll(r.Body)
if err != nil {
log.L.Errorf("Failed to read prefetch list: %v", err)
Expand All @@ -231,7 +231,7 @@ func (sc *Controller) setPrefetchConfiguration() func(w http.ResponseWriter, r *
}

func (sc *Controller) describeDaemons() func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, _ *http.Request) {
info := make([]daemonInfo, 0, 10)

for _, manager := range sc.managers {
Expand Down Expand Up @@ -282,7 +282,7 @@ func (sc *Controller) describeDaemons() func(w http.ResponseWriter, r *http.Requ

// TODO: Implement me!
func (sc *Controller) getDaemonRecords() func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, _ *http.Request) {
m := newErrorMessage("not implemented")
http.Error(w, m.encode(), http.StatusNotImplemented)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var (
DefaultAttempts = uint(10)
DefaultDelay = 100 * time.Millisecond
DefaultMaxJitter = 100 * time.Millisecond
DefaultOnRetry = func(n uint, err error) {}
DefaultOnRetry = func(_ uint, _ error) {}
DefaultRetryIf = IsRecoverable
DefaultDelayType = CombineDelay(FixedDelay, RandomDelay)
DefaultLastErrorOnly = false
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/transport/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (t FakeReference) Scope(action string) string {
func TestResolve(t *testing.T) {
var callCount int
failed := false
svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
callCount++
if !failed {
fmt.Fprintf(w, "ok")
Expand Down
4 changes: 2 additions & 2 deletions snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,13 +708,13 @@ func (o *snapshotter) workPath(id string) string {
}

func (o *snapshotter) findReferrerLayer(ctx context.Context, key string) (string, snapshots.Info, error) {
return snapshot.IterateParentSnapshots(ctx, o.ms, key, func(id string, info snapshots.Info) bool {
return snapshot.IterateParentSnapshots(ctx, o.ms, key, func(_ string, info snapshots.Info) bool {
return o.fs.CheckReferrer(ctx, info.Labels)
})
}

func (o *snapshotter) findMetaLayer(ctx context.Context, key string) (string, snapshots.Info, error) {
return snapshot.IterateParentSnapshots(ctx, o.ms, key, func(id string, i snapshots.Info) bool {
return snapshot.IterateParentSnapshots(ctx, o.ms, key, func(_ string, i snapshots.Info) bool {
return label.IsNydusMetaLayer(i.Labels)
})
}
Expand Down
2 changes: 1 addition & 1 deletion tests/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ func buildChunkDict(t *testing.T, workDir, fsVersion string, n int) (string, str
require.Equal(t, []digest.Digest{lowerNydusBlobDigest}, blobDigests)

dictBlobPath := ""
err = filepath.WalkDir(blobDir, func(path string, entry fs.DirEntry, err error) error {
err = filepath.WalkDir(blobDir, func(path string, _ fs.DirEntry, err error) error {
require.NoError(t, err)
if path == blobDir {
return nil
Expand Down

0 comments on commit 3e5ad7f

Please sign in to comment.