Skip to content

Commit

Permalink
fix: golang lint
Browse files Browse the repository at this point in the history
Signed-off-by: 泰友 <[email protected]>
  • Loading branch information
泰友 committed Mar 27, 2024
1 parent 82af10d commit 1a6eaed
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
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 1a6eaed

Please sign in to comment.