Skip to content

Commit df0d9d7

Browse files
committed
ci: update golangci-lint to v1.60.1
Previous version runs out of memory on go1.23 Signed-off-by: Tonis Tiigi <[email protected]>
1 parent 5e729c3 commit df0d9d7

File tree

11 files changed

+15
-11
lines changed

11 files changed

+15
-11
lines changed

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ linters:
3030
disable-all: true
3131

3232
linters-settings:
33+
staticcheck:
34+
checks:
35+
- "all"
3336
gocritic:
3437
disabled-checks:
3538
- "ifElseChain"
@@ -98,6 +101,7 @@ linters-settings:
98101
- "empty"
99102
- "bool-compare"
100103
- "len"
104+
- "negative-positive"
101105

102106
issues:
103107
exclude-files:

cache/contenthash/tarsum.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ func v0TarHeaderSelect(h *tar.Header) (orderedHeaders [][2]string) {
3737

3838
func v1TarHeaderSelect(h *tar.Header) (orderedHeaders [][2]string) {
3939
pax := h.PAXRecords
40-
if len(h.Xattrs) > 0 { //nolint:staticcheck // field deprecated in stdlib
40+
if len(h.Xattrs) > 0 { // field deprecated in stdlib
4141
if pax == nil {
4242
pax = map[string]string{}
43-
for k, v := range h.Xattrs { //nolint:staticcheck // field deprecated in stdlib
43+
for k, v := range h.Xattrs { // field deprecated in stdlib
4444
pax["SCHILY.xattr."+k] = v
4545
}
4646
}

executor/resources/cpu_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestReadPressureFile(t *testing.T) {
5757
full avg10=0.12 avg60=0.34 avg300=0.56 total=9876`
5858

5959
tmpFile := filepath.Join(t.TempDir(), "pressure_test")
60-
err := os.WriteFile(tmpFile, []byte(pressureContents), os.ModePerm)
60+
err := os.WriteFile(tmpFile, []byte(pressureContents), os.ModePerm) //nolint:gosec
6161
require.NoError(t, err)
6262

6363
pressure, err := parsePressureFile(tmpFile)

executor/runcexecutor/executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ func exitError(ctx context.Context, err error) error {
371371
)
372372
select {
373373
case <-ctx.Done():
374-
exitErr.Err = errors.Wrapf(context.Cause(ctx), exitErr.Error())
374+
exitErr.Err = errors.Wrap(context.Cause(ctx), exitErr.Error())
375375
return exitErr
376376
default:
377377
return stack.Enable(exitErr)

hack/dockerfiles/lint.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG GO_VERSION=1.22
44
ARG ALPINE_VERSION=3.20
55
ARG XX_VERSION=1.4.0
66
ARG PROTOLINT_VERSION=0.45.0
7-
ARG GOLANGCI_LINT_VERSION=1.57.1
7+
ARG GOLANGCI_LINT_VERSION=1.60.1
88
ARG GOPLS_VERSION=v0.20.0
99
# disabled: deprecated unusedvariable simplifyrange
1010
ARG GOPLS_ANALYZERS="embeddirective fillreturns infertypeargs nonewvars noresultvalues simplifycompositelit simplifyslice stubmethods undeclaredname unusedparams useany"

session/secrets/secretsprovider/secretsprovider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (sp *secretProvider) GetSecret(ctx context.Context, req *secrets.GetSecretR
3232
dt, err := sp.store.GetSecret(ctx, req.ID)
3333
if err != nil {
3434
if errors.Is(err, secrets.ErrNotFound) {
35-
return nil, status.Errorf(codes.NotFound, err.Error())
35+
return nil, status.Error(codes.NotFound, err.Error())
3636
}
3737
return nil, err
3838
}

solver/testutil/cachestorage_testsuite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func testWalkIDsByResult(t *testing.T, st solver.CacheKeyStorage) {
385385
func getFunctionName(i interface{}) string {
386386
fullname := runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
387387
dot := strings.LastIndex(fullname, ".") + 1
388-
return strings.Title(fullname[dot:]) //nolint:staticcheck // ignoring "SA1019: strings.Title is deprecated", as for our use we don't need full unicode support
388+
return strings.Title(fullname[dot:]) // ignoring "SA1019: strings.Title is deprecated", as for our use we don't need full unicode support
389389
}
390390

391391
func rootKey(dgst digest.Digest, output solver.Index) digest.Digest {

util/appcontext/appcontext.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func Context() context.Context {
3838
err := errors.Errorf("got %d SIGTERM/SIGINTs, forcing shutdown", retries)
3939
cancel(err)
4040
if retries >= exitLimit {
41-
bklog.G(ctx).Errorf(err.Error())
41+
bklog.G(ctx).Error(err.Error())
4242
os.Exit(1)
4343
}
4444
}

util/resolver/retryhandler/retry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func retryError(err error) bool {
6464
return true
6565
}
6666
// catches TLS timeout or other network-related temporary errors
67-
if ne := net.Error(nil); errors.As(err, &ne) && ne.Temporary() { //nolint:staticcheck // ignoring "SA1019: Temporary is deprecated", continue to propagate net.Error through the "temporary" status
67+
if ne := net.Error(nil); errors.As(err, &ne) && ne.Temporary() { // ignoring "SA1019: Temporary is deprecated", continue to propagate net.Error through the "temporary" status
6868
return true
6969
}
7070

util/testutil/integration/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func Run(t *testing.T, testCases []Test, opt ...TestOpt) {
220220
func getFunctionName(i interface{}) string {
221221
fullname := runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
222222
dot := strings.LastIndex(fullname, ".") + 1
223-
return strings.Title(fullname[dot:]) //nolint:staticcheck // ignoring "SA1019: strings.Title is deprecated", as for our use we don't need full unicode support
223+
return strings.Title(fullname[dot:]) // ignoring "SA1019: strings.Title is deprecated", as for our use we don't need full unicode support
224224
}
225225

226226
var localImageCache map[string]map[string]struct{}

0 commit comments

Comments
 (0)