Skip to content

Commit 4716af5

Browse files
committed
lints: update to golangci-lint v2.6
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
1 parent 13c7ab5 commit 4716af5

File tree

9 files changed

+11
-9
lines changed

9 files changed

+11
-9
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ jobs:
5151
with:
5252
go-version: '^1'
5353
- name: golangci-lint
54-
uses: golangci/golangci-lint-action@v8
54+
uses: golangci/golangci-lint-action@v9
5555
with:
56-
version: v2.5
56+
version: v2.6
5757
- name: go fix
5858
run: |
5959
go fix ./...

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ formatters:
6262
- gofumpt
6363
- goimports
6464
settings:
65+
gofumpt:
66+
extra-rules: true
6567
goimports:
6668
local-prefixes:
6769
- github.com/opencontainers/umoci

internal/system/xattr_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func Llistxattr(path string) ([]string, error) {
7070

7171
// Lgetxattr is a wrapper around unix.Lgetattr, to abstract the resizing of the
7272
// returned []string.
73-
func Lgetxattr(path string, name string) ([]byte, error) {
73+
func Lgetxattr(path, name string) ([]byte, error) {
7474
var buffer []byte //nolint:prealloc // we do pre-allocate later
7575
for {
7676
// Find the size.

oci/layer/layer_fuzzer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import (
4141
"github.com/opencontainers/umoci/oci/casext"
4242
)
4343

44-
func createRandomFile(dirpath string, filename []byte, filecontents []byte) error {
44+
func createRandomFile(dirpath string, filename, filecontents []byte) error {
4545
fileP := filepath.Join(dirpath, string(filename))
4646
if err := os.WriteFile(fileP, filecontents, 0o644); err != nil {
4747
return err

oci/layer/tar_extract.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func (te *TarExtractor) applyMetadata(path string, hdr *tar.Header) error {
274274
// we should extract through the link or clobber the link with a directory (in
275275
// the case where we see a directory to extract and a symlink already exists
276276
// there).
277-
func (te *TarExtractor) isDirlink(root string, path string) (bool, error) {
277+
func (te *TarExtractor) isDirlink(root, path string) (bool, error) {
278278
// Make sure it exists and is a symlink.
279279
if _, err := te.fsEval.Readlink(path); err != nil {
280280
return false, fmt.Errorf("read dirlink: %w", err)

pkg/fseval/fseval.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type FsEval interface {
7777
Lsetxattr(path, name string, value []byte, flags int) error
7878

7979
// Lgetxattr is equivalent to system.Lgetxattr
80-
Lgetxattr(path string, name string) ([]byte, error)
80+
Lgetxattr(path, name string) ([]byte, error)
8181

8282
// Lclearxattrs is equivalent to system.Lclearxattrs
8383
Lclearxattrs(path string, skipFn func(xattr string) bool) error

pkg/fseval/fseval_default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (fs osFsEval) Lsetxattr(path, name string, value []byte, flags int) error {
132132
}
133133

134134
// Lgetxattr is equivalent to system.Lgetxattr.
135-
func (fs osFsEval) Lgetxattr(path string, name string) ([]byte, error) {
135+
func (fs osFsEval) Lgetxattr(path, name string) ([]byte, error) {
136136
return system.Lgetxattr(path, name)
137137
}
138138

pkg/fseval/fseval_rootless.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (fs unprivFsEval) Lsetxattr(path, name string, value []byte, flags int) err
120120
}
121121

122122
// Lgetxattr is equivalent to unpriv.Lgetxattr.
123-
func (fs unprivFsEval) Lgetxattr(path string, name string) ([]byte, error) {
123+
func (fs unprivFsEval) Lgetxattr(path, name string) ([]byte, error) {
124124
return unpriv.Lgetxattr(path, name)
125125
}
126126

utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ func Stat(ctx context.Context, engine casext.Engine, manifestDescriptor ispec.De
718718

719719
// GenerateBundleManifest creates and writes an mtree of the rootfs in the given
720720
// bundle path, using the supplied fsEval method.
721-
func GenerateBundleManifest(mtreeName string, bundlePath string, fsEval mtree.FsEval) (Err error) {
721+
func GenerateBundleManifest(mtreeName, bundlePath string, fsEval mtree.FsEval) (Err error) {
722722
mtreePath := filepath.Join(bundlePath, mtreeName+".mtree")
723723
fullRootfsPath := filepath.Join(bundlePath, layer.RootfsName)
724724

0 commit comments

Comments
 (0)