Skip to content

Commit

Permalink
feat: upgrade golanglint
Browse files Browse the repository at this point in the history
Signed-off-by: 泰友 <[email protected]>
  • Loading branch information
泰友 authored and ccx1024cc committed Mar 28, 2024
1 parent b1461f0 commit 95a95e8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
export NYDUS_NYDUSIFY_$version_export=/usr/bin/nydus-$version/nydusify
done
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.51.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.57.1
sudo -E make smoke-only
nydus-unit-test:
Expand Down
2 changes: 1 addition & 1 deletion smoke/tests/tool/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ func (ctx *Context) PrepareWorkDir(t *testing.T) {
}
}

func (ctx *Context) Destroy(t *testing.T) {
func (ctx *Context) Destroy(_ *testing.T) {
os.RemoveAll(ctx.Env.WorkDir)
}
5 changes: 2 additions & 3 deletions smoke/tests/tool/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ func (c *DescartesIterator) calNext() {
carried = true
cursors[idx]++
break
} else {
carried = false
cursors[idx] = 0
}
carried = false
cursors[idx] = 0
}
if !carried {
c.noNext()
Expand Down
6 changes: 3 additions & 3 deletions smoke/tests/tool/layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (l *Layer) PackRef(t *testing.T, ctx Context, blobDir string, compress bool
return ociBlobDigest, rafsBlobDigest
}

func (l *Layer) Overlay(t *testing.T, upper *Layer) *Layer {
func (l *Layer) Overlay(_ *testing.T, upper *Layer) *Layer {
// Handle whiteout/opaque files
for upperName := range upper.FileTree {
name := filepath.Base(upperName)
Expand Down Expand Up @@ -231,14 +231,14 @@ func (l *Layer) Overlay(t *testing.T, upper *Layer) *Layer {

func (l *Layer) recordFileTree(t *testing.T) {
l.FileTree = map[string]*File{}
filepath.Walk(l.workDir, func(path string, fi os.FileInfo, err error) error {
filepath.Walk(l.workDir, func(path string, _ os.FileInfo, _ error) error {
targetPath := l.TargetPath(t, path)
l.FileTree[targetPath] = NewFile(t, path, targetPath)
return nil
})
}

func (l *Layer) toOCITar(t *testing.T) io.ReadCloser {
func (l *Layer) toOCITar(_ *testing.T) io.ReadCloser {
return archive.Diff(context.Background(), "", l.workDir)
}

Expand Down
2 changes: 1 addition & 1 deletion smoke/tests/tool/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func Verify(t *testing.T, ctx Context, expectedFiles map[string]*File) {
}()

actualFiles := map[string]*File{}
err = filepath.WalkDir(ctx.Env.MountDir, func(path string, entry fs.DirEntry, err error) error {
err = filepath.WalkDir(ctx.Env.MountDir, func(path string, _ fs.DirEntry, err error) error {
require.Nil(t, err)

targetPath, err := filepath.Rel(ctx.Env.MountDir, path)
Expand Down

0 comments on commit 95a95e8

Please sign in to comment.