From d14b7e8d09695339fb4e020a04b76a533129791e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 15:31:42 +0200 Subject: [PATCH 01/10] golangci-lint: remove exclusions for ST1020, ST1022 Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 958b86998f..7a6d7944cf 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -133,8 +133,6 @@ linters: checks: - all - -QF1008 # Omit embedded fields from selector expression - - -ST1020 # The documentation of an exported function should start with the function’s name - - -ST1022 # The documentation of an exported variable or constant should start with variable’s name revive: rules: @@ -207,6 +205,12 @@ linters: linters: - govet + # Ignore for cli/command/formatter/tabwriter, which is forked from go stdlib, so we want to align with it. + - text: '^(ST1020|ST1022): comment on exported' + path: "cli/command/formatter/tabwriter" + linters: + - staticcheck + # Log a warning if an exclusion rule is unused. # Default: false warn-unused: true From 2ef9ab44945585c4cee91a819d22dc27d88788e1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 15:25:03 +0200 Subject: [PATCH 02/10] golangci-lint: align comments Format comments to be the same as in moby/moby for easier comparing. Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 52 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 7a6d7944cf..fee407cd75 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -27,38 +27,38 @@ formatters: linters: enable: - bodyclose - - copyloopvar # Detects places where loop variables are copied. + - copyloopvar # Detects places where loop variables are copied. - depguard - - dogsled - - dupword # Detects duplicate words. - - durationcheck + - dogsled # Detects assignments with too many blank identifiers. + - dupword # Detects duplicate words. + - durationcheck # Detect cases where two time.Duration values are being multiplied in possibly erroneous ways. - errcheck - - errchkjson + - errchkjson # Detects unsupported types passed to json encoding functions and reports if checks for the returned error can be omitted. - forbidigo - - gocritic # Metalinter; detects bugs, performance, and styling issues. + - gocritic # Metalinter; detects bugs, performance, and styling issues. - gocyclo - - gosec # Detects security problems. + - gosec # Detects security problems. - govet + - importas # Enforces consistent import aliases. - ineffassign - - importas # Enforces consistent import aliases. - - misspell # Detects commonly misspelled English words in comments. - - nakedret # Detects uses of naked returns. - - nilerr # Detects code that returns nil even if it checks that the error is not nil. - - nolintlint # Detects ill-formed or insufficient nolint directives. - - perfsprint # Detects fmt.Sprintf uses that can be replaced with a faster alternative. - - prealloc # Detects slice declarations that could potentially be pre-allocated. - - predeclared # Detects code that shadows one of Go's predeclared identifiers - - reassign - - revive # Metalinter; drop-in replacement for golint. + - misspell # Detects commonly misspelled English words in comments. + - nakedret # Detects uses of naked returns. + - nilerr # Detects code that returns nil even if it checks that the error is not nil. + - nolintlint # Detects ill-formed or insufficient nolint directives. + - perfsprint # Detects fmt.Sprintf uses that can be replaced with a faster alternative. + - prealloc # Detects slice declarations that could potentially be pre-allocated. + - predeclared # Detects code that shadows one of Go's predeclared identifiers + - reassign # Detects reassigning a top-level variable in another package. + - revive # Metalinter; drop-in replacement for golint. - staticcheck - - thelper # Detects test helpers without t.Helper(). - - tparallel # Detects inappropriate usage of t.Parallel(). - - unconvert # Detects unnecessary type conversions. + - thelper # Detects test helpers without t.Helper(). + - tparallel # Detects inappropriate usage of t.Parallel(). + - unconvert # Detects unnecessary type conversions. - unparam - unused - - usestdlibvars - - usetesting # Reports uses of functions with replacement inside the testing package. - - wastedassign + - usestdlibvars # Detects the possibility to use variables/constants from the Go standard library. + - usetesting # Reports uses of functions with replacement inside the testing package. + - wastedassign # Detects wasted assignment statements. disable: - errcheck @@ -132,7 +132,7 @@ linters: staticcheck: checks: - all - - -QF1008 # Omit embedded fields from selector expression + - -QF1008 # Omit embedded fields from selector expression; https://staticcheck.dev/docs/checks/#QF1008 revive: rules: @@ -157,8 +157,8 @@ linters: # (unlike the "include" option), the "exclude" option does not take exclusion # ID's. # - # These exclusion patterns are copied from the default excluses at: - # https://github.com/golangci/golangci-lint/blob/v1.44.0/pkg/config/issues.go#L10-L104 + # These exclusion patterns are copied from the default excludes at: + # https://github.com/golangci/golangci-lint/blob/v1.61.0/pkg/config/issues.go#L11-L104 # # The default list of exclusions can be found at: # https://golangci-lint.run/usage/false-positives/#default-exclusions From 062ad57ce24dbec6ab1385716a7f92ed4f66f02f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 18:07:10 +0200 Subject: [PATCH 03/10] golangci-lint: enable mirror linter Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 1 + cli/command/swarm/ca_test.go | 2 +- e2e/cli-plugins/socket_test.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index fee407cd75..8c105cc555 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -41,6 +41,7 @@ linters: - govet - importas # Enforces consistent import aliases. - ineffassign + - mirror # Detects wrong mirror patterns of bytes/strings usage. - misspell # Detects commonly misspelled English words in comments. - nakedret # Detects uses of naked returns. - nilerr # Detects code that returns nil even if it checks that the error is not nil. diff --git a/cli/command/swarm/ca_test.go b/cli/command/swarm/ca_test.go index 88df4d164e..9b7107d4fe 100644 --- a/cli/command/swarm/ca_test.go +++ b/cli/command/swarm/ca_test.go @@ -69,7 +69,7 @@ func writeFile(data string) (string, error) { if err != nil { return "", err } - _, err = tmpfile.Write([]byte(data)) + _, err = tmpfile.WriteString(data) if err != nil { return "", err } diff --git a/e2e/cli-plugins/socket_test.go b/e2e/cli-plugins/socket_test.go index c754e27111..2bb93dd8f2 100644 --- a/e2e/cli-plugins/socket_test.go +++ b/e2e/cli-plugins/socket_test.go @@ -58,7 +58,7 @@ func TestPluginSocketBackwardsCompatible(t *testing.T) { ptmx, err := pty.Start(command) assert.NilError(t, err, "failed to launch command with fake TTY") - _, _ = ptmx.Write([]byte("hello!")) + _, _ = ptmx.WriteString("hello!") done := make(chan error) go func() { From b64d9b3b19b8a19149b82d1a1418bc925e81d0ad Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 18:10:25 +0200 Subject: [PATCH 04/10] golangci-lint: replace nilerr for nilnesserr Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 8c105cc555..71a295034f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -44,7 +44,7 @@ linters: - mirror # Detects wrong mirror patterns of bytes/strings usage. - misspell # Detects commonly misspelled English words in comments. - nakedret # Detects uses of naked returns. - - nilerr # Detects code that returns nil even if it checks that the error is not nil. + - nilnesserr # Detects returning nil errors. It combines the features of nilness and nilerr, - nolintlint # Detects ill-formed or insufficient nolint directives. - perfsprint # Detects fmt.Sprintf uses that can be replaced with a faster alternative. - prealloc # Detects slice declarations that could potentially be pre-allocated. From d65f0c9bbf4dba8268ab482a0ea938fac4bf12d7 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 19:10:53 +0200 Subject: [PATCH 05/10] golangci-lint: enable exhaustive linter Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 1 + cli-plugins/manager/manager.go | 2 +- cli/command/formatter/displayutils.go | 2 ++ cli/command/swarm/unlock.go | 9 ++++----- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 71a295034f..f16bfa547a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -34,6 +34,7 @@ linters: - durationcheck # Detect cases where two time.Duration values are being multiplied in possibly erroneous ways. - errcheck - errchkjson # Detects unsupported types passed to json encoding functions and reports if checks for the returned error can be omitted. + - exhaustive # Detects missing options in enum switch statements. - forbidigo - gocritic # Metalinter; detects bugs, performance, and styling issues. - gocyclo diff --git a/cli-plugins/manager/manager.go b/cli-plugins/manager/manager.go index 44695a837a..25515bccb8 100644 --- a/cli-plugins/manager/manager.go +++ b/cli-plugins/manager/manager.go @@ -81,7 +81,7 @@ func addPluginCandidatesFromDir(res map[string][]string, d string) { return } for _, dentry := range dentries { - switch dentry.Type() & os.ModeType { + switch dentry.Type() & os.ModeType { //nolint:exhaustive,nolintlint // no need to include all possible file-modes in this list case 0, os.ModeSymlink: // Regular file or symlink, keep going default: diff --git a/cli/command/formatter/displayutils.go b/cli/command/formatter/displayutils.go index a7520e86f2..c6d2845c4e 100644 --- a/cli/command/formatter/displayutils.go +++ b/cli/command/formatter/displayutils.go @@ -20,6 +20,8 @@ func charWidth(r rune) int { switch width.LookupRune(r).Kind() { case width.EastAsianWide, width.EastAsianFullwidth: return 2 + case width.Neutral, width.EastAsianAmbiguous, width.EastAsianNarrow, width.EastAsianHalfwidth: + return 1 default: return 1 } diff --git a/cli/command/swarm/unlock.go b/cli/command/swarm/unlock.go index 66ae6d5371..420482ee1e 100644 --- a/cli/command/swarm/unlock.go +++ b/cli/command/swarm/unlock.go @@ -50,7 +50,7 @@ func runUnlock(ctx context.Context, dockerCli command.Cli) error { return errors.New("Error: This node is not part of a swarm") case swarm.LocalNodeStateLocked: break - default: + case swarm.LocalNodeStatePending, swarm.LocalNodeStateActive, swarm.LocalNodeStateError: return errors.New("Error: swarm is not locked") } @@ -58,11 +58,10 @@ func runUnlock(ctx context.Context, dockerCli command.Cli) error { if err != nil { return err } - req := swarm.UnlockRequest{ - UnlockKey: key, - } - return client.SwarmUnlock(ctx, req) + return client.SwarmUnlock(ctx, swarm.UnlockRequest{ + UnlockKey: key, + }) } func readKey(in *streams.In, prompt string) (string, error) { From 18e911c958ed4f7bf62f7eece4754fab521d5381 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 19:22:12 +0200 Subject: [PATCH 06/10] cli/command/container: TestContainerStatsContextWriteTrunc: use subtests Signed-off-by: Sebastiaan van Stijn --- cli/command/container/formatter_stats_test.go | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/cli/command/container/formatter_stats_test.go b/cli/command/container/formatter_stats_test.go index b3011902ec..bf85d2e130 100644 --- a/cli/command/container/formatter_stats_test.go +++ b/cli/command/container/formatter_stats_test.go @@ -273,36 +273,37 @@ func TestContainerStatsContextWriteWithNoStatsWindows(t *testing.T) { } func TestContainerStatsContextWriteTrunc(t *testing.T) { - var out bytes.Buffer - - contexts := []struct { + tests := []struct { + doc string context formatter.Context trunc bool expected string }{ { - formatter.Context{ + doc: "non-truncated", + context: formatter.Context{ Format: "{{.ID}}", - Output: &out, }, - false, - "b95a83497c9161c9b444e3d70e1a9dfba0c1840d41720e146a95a08ebf938afc\n", + expected: "b95a83497c9161c9b444e3d70e1a9dfba0c1840d41720e146a95a08ebf938afc\n", }, { - formatter.Context{ + doc: "truncated", + context: formatter.Context{ Format: "{{.ID}}", - Output: &out, }, - true, - "b95a83497c91\n", + trunc: true, + expected: "b95a83497c91\n", }, } - for _, context := range contexts { - statsFormatWrite(context.context, []StatsEntry{{ID: "b95a83497c9161c9b444e3d70e1a9dfba0c1840d41720e146a95a08ebf938afc"}}, "linux", context.trunc) - assert.Check(t, is.Equal(context.expected, out.String())) - // Clean buffer - out.Reset() + for _, tc := range tests { + t.Run(tc.doc, func(t *testing.T) { + var out bytes.Buffer + tc.context.Output = &out + err := statsFormatWrite(tc.context, []StatsEntry{{ID: "b95a83497c9161c9b444e3d70e1a9dfba0c1840d41720e146a95a08ebf938afc"}}, "linux", tc.trunc) + assert.NilError(t, err) + assert.Check(t, is.Equal(tc.expected, out.String())) + }) } } From c1313a92a098e716b19da6112f66b5e053747bc5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 19:23:08 +0200 Subject: [PATCH 07/10] golangci-lint: enable makezero linter cli/command/container/formatter_stats_test.go:339:11: append to slice `stats` with non-zero initialized length (makezero) stats = append(stats, entry) ^ Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 1 + cli/command/container/formatter_stats_test.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f16bfa547a..2432972bd2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -42,6 +42,7 @@ linters: - govet - importas # Enforces consistent import aliases. - ineffassign + - makezero # Finds slice declarations with non-zero initial length. - mirror # Detects wrong mirror patterns of bytes/strings usage. - misspell # Detects commonly misspelled English words in comments. - nakedret # Detects uses of naked returns. diff --git a/cli/command/container/formatter_stats_test.go b/cli/command/container/formatter_stats_test.go index bf85d2e130..8569ef4de4 100644 --- a/cli/command/container/formatter_stats_test.go +++ b/cli/command/container/formatter_stats_test.go @@ -148,7 +148,7 @@ container2 -- -- `, }, } - stats := []StatsEntry{ + entries := []StatsEntry{ { Container: "container1", CPUPercentage: 20, @@ -181,7 +181,7 @@ container2 -- -- t.Run(string(tc.context.Format), func(t *testing.T) { var out bytes.Buffer tc.context.Output = &out - err := statsFormatWrite(tc.context, stats, "windows", false) + err := statsFormatWrite(tc.context, entries, "windows", false) if err != nil { assert.Error(t, err, tc.expected) } else { @@ -309,10 +309,10 @@ func TestContainerStatsContextWriteTrunc(t *testing.T) { func BenchmarkStatsFormat(b *testing.B) { b.ReportAllocs() - stats := genStats() + entries := genStats() for i := 0; i < b.N; i++ { - for _, s := range stats { + for _, s := range entries { _ = s.CPUPerc() _ = s.MemUsage() _ = s.MemPerc() @@ -335,9 +335,9 @@ func genStats() []statsContext { NetworkTx: 987.654321, PidsCurrent: 123456789, }} - stats := make([]statsContext, 100) - for i := 0; i < 100; i++ { - stats = append(stats, entry) + entries := make([]statsContext, 0, 100) + for range 100 { + entries = append(entries, entry) } - return stats + return entries } From 615ffee13b6b5f85994b7cae707a7e1676edbd74 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 19:35:29 +0200 Subject: [PATCH 08/10] golangci-lint: enable nosprintfhostport linter Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 1 + opts/hosts_test.go | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2432972bd2..14e5b9e527 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -47,6 +47,7 @@ linters: - misspell # Detects commonly misspelled English words in comments. - nakedret # Detects uses of naked returns. - nilnesserr # Detects returning nil errors. It combines the features of nilness and nilerr, + - nosprintfhostport # Detects misuse of Sprintf to construct a host with port in a URL. - nolintlint # Detects ill-formed or insufficient nolint directives. - perfsprint # Detects fmt.Sprintf uses that can be replaced with a faster alternative. - prealloc # Detects slice declarations that could potentially be pre-allocated. diff --git a/opts/hosts_test.go b/opts/hosts_test.go index f1096c4f64..28f4eb6fab 100644 --- a/opts/hosts_test.go +++ b/opts/hosts_test.go @@ -1,7 +1,7 @@ package opts import ( - "fmt" + "net" "testing" "gotest.tools/v3/assert" @@ -25,13 +25,13 @@ func TestParseHost(t *testing.T) { "fd://something": "fd://something", "tcp://host:": "tcp://host:" + defaultHTTPPort, "tcp://": defaultTCPHost, - "tcp://:2375": fmt.Sprintf("tcp://%s:%s", defaultHTTPHost, defaultHTTPPort), - "tcp://:2376": fmt.Sprintf("tcp://%s:%s", defaultHTTPHost, defaultTLSHTTPPort), + "tcp://:2375": "tcp://" + net.JoinHostPort(defaultHTTPHost, defaultHTTPPort), + "tcp://:2376": "tcp://" + net.JoinHostPort(defaultHTTPHost, defaultTLSHTTPPort), "tcp://0.0.0.0:8080": "tcp://0.0.0.0:8080", "tcp://192.168.0.0:12000": "tcp://192.168.0.0:12000", "tcp://192.168:8080": "tcp://192.168:8080", "tcp://0.0.0.0:1234567890": "tcp://0.0.0.0:1234567890", // yeah it's valid :P - " tcp://:7777/path ": fmt.Sprintf("tcp://%s:7777/path", defaultHTTPHost), + " tcp://:7777/path ": "tcp://" + net.JoinHostPort(defaultHTTPHost, "7777") + "/path", "tcp://docker.com:2375": "tcp://docker.com:2375", "unix://": "unix://" + defaultUnixSocket, "unix://path/to/socket": "unix://path/to/socket", @@ -70,11 +70,11 @@ func TestParseDockerDaemonHost(t *testing.T) { "[::1]:5555/path": "tcp://[::1]:5555/path", "[0:0:0:0:0:0:0:1]:": "tcp://[0:0:0:0:0:0:0:1]:2375", "[0:0:0:0:0:0:0:1]:5555/path": "tcp://[0:0:0:0:0:0:0:1]:5555/path", - ":6666": fmt.Sprintf("tcp://%s:6666", defaultHTTPHost), - ":6666/path": fmt.Sprintf("tcp://%s:6666/path", defaultHTTPHost), + ":6666": "tcp://" + net.JoinHostPort(defaultHTTPHost, "6666"), + ":6666/path": "tcp://" + net.JoinHostPort(defaultHTTPHost, "6666") + "/path", "tcp://": defaultTCPHost, - "tcp://:7777": fmt.Sprintf("tcp://%s:7777", defaultHTTPHost), - "tcp://:7777/path": fmt.Sprintf("tcp://%s:7777/path", defaultHTTPHost), + "tcp://:7777": "tcp://" + net.JoinHostPort(defaultHTTPHost, "7777"), + "tcp://:7777/path": "tcp://" + net.JoinHostPort(defaultHTTPHost, "7777") + "/path", "unix:///run/docker.sock": "unix:///run/docker.sock", "unix://": "unix://" + defaultUnixSocket, "fd://": "fd://", @@ -96,7 +96,7 @@ func TestParseDockerDaemonHost(t *testing.T) { } func TestParseTCP(t *testing.T) { - defaultHTTPHost := "tcp://127.0.0.1:2376" + const defaultHost = "tcp://127.0.0.1:2376" invalids := map[string]string{ "tcp:a.b.c.d": "", "tcp:a.b.c.d/path": "", @@ -104,8 +104,8 @@ func TestParseTCP(t *testing.T) { "udp://127.0.0.1:2375": "invalid proto, expected tcp: udp://127.0.0.1:2375", } valids := map[string]string{ - "": defaultHTTPHost, - "tcp://": defaultHTTPHost, + "": defaultHost, + "tcp://": defaultHost, "0.0.0.1:": "tcp://0.0.0.1:2376", "0.0.0.1:5555": "tcp://0.0.0.1:5555", "0.0.0.1:5555/path": "tcp://0.0.0.1:5555/path", @@ -124,12 +124,12 @@ func TestParseTCP(t *testing.T) { "localhost:5555/path": "tcp://localhost:5555/path", } for invalidAddr, expectedError := range invalids { - if addr, err := ParseTCPAddr(invalidAddr, defaultHTTPHost); err == nil || expectedError != "" && err.Error() != expectedError { + if addr, err := ParseTCPAddr(invalidAddr, defaultHost); err == nil || expectedError != "" && err.Error() != expectedError { t.Errorf("tcp %v address expected error %v return, got %s and addr %v", invalidAddr, expectedError, err, addr) } } for validAddr, expectedAddr := range valids { - if addr, err := ParseTCPAddr(validAddr, defaultHTTPHost); err != nil || addr != expectedAddr { + if addr, err := ParseTCPAddr(validAddr, defaultHost); err != nil || addr != expectedAddr { t.Errorf("%v -> expected %v, got %v and addr %v", validAddr, expectedAddr, err, addr) } } From d1e9946ab8e4598b971eac759cf9425c4bccaedb Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 19:12:24 +0200 Subject: [PATCH 09/10] golangci-lint: enable more linters Enables the asasalint, exptostd, fatcontext, gocheckcompilerdirectives, iface, makezero, and spancheck linters. Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 14e5b9e527..7cefcecf0b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,6 +26,7 @@ formatters: linters: enable: + - asasalint # Detects "[]any" used as argument for variadic "func(...any)". - bodyclose - copyloopvar # Detects places where loop variables are copied. - depguard @@ -35,11 +36,15 @@ linters: - errcheck - errchkjson # Detects unsupported types passed to json encoding functions and reports if checks for the returned error can be omitted. - exhaustive # Detects missing options in enum switch statements. + - exptostd # Detects functions from golang.org/x/exp/ that can be replaced by std functions. + - fatcontext # Detects nested contexts in loops and function literals. - forbidigo + - gocheckcompilerdirectives # Detects invalid go compiler directive comments (//go:). - gocritic # Metalinter; detects bugs, performance, and styling issues. - gocyclo - gosec # Detects security problems. - govet + - iface # Detects incorrect use of interfaces. Currently only used for "identical" interfaces in the same package. - importas # Enforces consistent import aliases. - ineffassign - makezero # Finds slice declarations with non-zero initial length. @@ -54,6 +59,7 @@ linters: - predeclared # Detects code that shadows one of Go's predeclared identifiers - reassign # Detects reassigning a top-level variable in another package. - revive # Metalinter; drop-in replacement for golint. + - spancheck # Detects mistakes with OpenTelemetry/Census spans. - staticcheck - thelper # Detects test helpers without t.Helper(). - tparallel # Detects inappropriate usage of t.Parallel(). From 9d027dff4085ff34186e9f04ce33784cdd95ac31 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 20:16:23 +0200 Subject: [PATCH 10/10] Dockerfile: update golangci-lint to v2.1.5 Signed-off-by: Sebastiaan van Stijn --- dockerfiles/Dockerfile.lint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile.lint b/dockerfiles/Dockerfile.lint index 3a5cdf61fb..fbd6126255 100644 --- a/dockerfiles/Dockerfile.lint +++ b/dockerfiles/Dockerfile.lint @@ -2,7 +2,7 @@ ARG GO_VERSION=1.24.3 ARG ALPINE_VERSION=3.21 -ARG GOLANGCI_LINT_VERSION=v2.1.2 +ARG GOLANGCI_LINT_VERSION=v2.1.5 FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint