Skip to content

Commit 31e2a16

Browse files
authored
Merge pull request #133 from pjbgf/bump
Bump golangci to `v2.1.6`
2 parents 77cb772 + b0cb6a2 commit 31e2a16

File tree

6 files changed

+33
-16
lines changed

6 files changed

+33
-16
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CodeQL
22

33
on:
44
push:
5-
branches: [ "master", "main" ]
5+
branches: [ "main" ]
66
pull_request:
77
schedule:
88
- cron: '00 5 * * 1'

.github/workflows/test_wasip1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Test wasip1
22

33
on:
44
push:
5-
branches: [ "master", "main" ]
5+
branches: [ "main" ]
66
pull_request:
77

88
permissions: {}

.golangci.yaml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
version: "2"
12
linters:
2-
disable-all: true
3+
default: none
34
enable:
45
- asasalint
56
- asciicheck
@@ -22,10 +23,8 @@ linters:
2223
- gochecknoinits
2324
- gochecksumtype
2425
- goheader
25-
- goimports
2626
- gomodguard
2727
- goprintffuncname
28-
- gosimple
2928
- gosmopolitan
3029
- govet
3130
- grouper
@@ -44,14 +43,33 @@ linters:
4443
- sloglint
4544
- spancheck
4645
- sqlclosecheck
46+
- staticcheck
4747
- tagalign
4848
- tagliatelle
49-
- tenv
5049
- testableexamples
51-
- typecheck
5250
- unconvert
5351
- unused
5452
- usestdlibvars
5553
- wastedassign
5654
- whitespace
5755
- zerologlint
56+
exclusions:
57+
generated: lax
58+
presets:
59+
- comments
60+
- common-false-positives
61+
- legacy
62+
- std-error-handling
63+
paths:
64+
- third_party$
65+
- builtin$
66+
- examples$
67+
formatters:
68+
enable:
69+
- goimports
70+
exclusions:
71+
generated: lax
72+
paths:
73+
- third_party$
74+
- builtin$
75+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ GOCMD = go
33
GOTEST = $(GOCMD) test
44
WASIRUN_WRAPPER := $(CURDIR)/scripts/wasirun-wrapper
55

6-
GOLANGCI_VERSION ?= v1.64.5
6+
GOLANGCI_VERSION ?= v2.1.6
77
TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools)
88

99
GOLANGCI = $(TOOLS_BIN)/golangci-lint-$(GOLANGCI_VERSION)

osfs/os_posix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ func (f *file) Lock() error {
1414
f.m.Lock()
1515
defer f.m.Unlock()
1616

17-
return unix.Flock(int(f.File.Fd()), unix.LOCK_EX)
17+
return unix.Flock(int(f.Fd()), unix.LOCK_EX)
1818
}
1919

2020
func (f *file) Unlock() error {
2121
f.m.Lock()
2222
defer f.m.Unlock()
2323

24-
return unix.Flock(int(f.File.Fd()), unix.LOCK_UN)
24+
return unix.Flock(int(f.Fd()), unix.LOCK_UN)
2525
}
2626

2727
func rename(from, to string) error {

test/basic_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"strings"
1313
"testing"
1414

15-
"github.com/go-git/go-billy/v6"
1615
. "github.com/go-git/go-billy/v6" //nolint
1716
"github.com/go-git/go-billy/v6/osfs"
1817
"github.com/go-git/go-billy/v6/util"
@@ -71,7 +70,7 @@ func TestCreateOverwrite(t *testing.T) {
7170
f, err := fs.Create("foo")
7271
require.NoError(t, err)
7372

74-
l, err := f.Write([]byte(fmt.Sprintf("foo%d", i)))
73+
l, err := fmt.Fprintf(f, "foo%d", i)
7574
require.NoError(t, err)
7675
assert.Equal(t, 4, l)
7776

@@ -477,7 +476,7 @@ func TestStatNonExistent(t *testing.T) {
477476
func TestRename(t *testing.T) {
478477
tests := []struct {
479478
name string
480-
before func(*testing.T, billy.Filesystem)
479+
before func(*testing.T, Filesystem)
481480
from string
482481
to string
483482
wantErr *error
@@ -491,7 +490,7 @@ func TestRename(t *testing.T) {
491490
},
492491
{
493492
name: "file rename",
494-
before: func(t *testing.T, fs billy.Filesystem) {
493+
before: func(t *testing.T, fs Filesystem) {
495494
root := fsRoot(fs)
496495
f, err := fs.Create(fs.Join(root, "foo"))
497496
require.NoError(t, err)
@@ -503,7 +502,7 @@ func TestRename(t *testing.T) {
503502
},
504503
{
505504
name: "dir rename",
506-
before: func(t *testing.T, fs billy.Filesystem) {
505+
before: func(t *testing.T, fs Filesystem) {
507506
root := fsRoot(fs)
508507
f, err := fs.Create(fs.Join(root, "foo", "bar1"))
509508
require.NoError(t, err)
@@ -568,7 +567,7 @@ func TestRename(t *testing.T) {
568567
})
569568
}
570569

571-
func fsRoot(fs billy.Filesystem) string {
570+
func fsRoot(fs Filesystem) string {
572571
if reflect.TypeOf(fs) == reflect.TypeOf(&osfs.BoundOS{}) {
573572
return fs.Root()
574573
}

0 commit comments

Comments
 (0)