Skip to content

Commit 7772a78

Browse files
chore(deps): update dependency golangci/golangci-lint to v2.12.1 (#1616)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Vincent Link <[email protected]>
1 parent 271a38e commit 7772a78

5 files changed

Lines changed: 14 additions & 12 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
version: ${{ env.GOLANGCI_LINT_VERSION }}
5656
env:
5757
# renovate: datasource=github-releases depName=golangci/golangci-lint
58-
GOLANGCI_LINT_VERSION: "v2.11.4"
58+
GOLANGCI_LINT_VERSION: "v2.12.1"
5959
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
6060
env:
6161
SKIP: golangci-lint

.golangci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,19 @@ linters:
2828
- unparam # reports unused function parameters
2929
- unused # checks for unused code
3030
- whitespace # checks for unnecessary newlines
31+
settings:
32+
goconst:
33+
ignore-tests: true
3134
exclusions:
3235
generated: lax # exclude generated files
3336
presets:
3437
# suppress "exported X should have comment" — not all exports are documented
3538
- comments
3639
rules:
37-
# test files: relax duplicate detection, unused params, and repeated strings
40+
# test files: relax duplicate detection and unused params
3841
- linters:
3942
- dupl
4043
- unparam
41-
- goconst
4244
path: _test\.go
4345
- linters:
4446
- revive

test/helpers/app.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import (
1515

1616
const (
1717
// renovate: datasource=docker
18-
defaultImage = "ghcr.io/traefik/whoami:v1.11.0"
19-
defaultPort = int32(8080)
18+
defaultImage = "ghcr.io/traefik/whoami:v1.11.0"
19+
defaultPort = int32(8080)
20+
tlsCertsVolume = "tls-certs"
2021
)
2122

2223
// TestApp bundles a Deployment and Service for a test backend.
@@ -81,12 +82,12 @@ func (a *TestApp) Resources() []k8s.Object {
8182
probeScheme = corev1.URISchemeHTTPS
8283
args = append(args, "--cert=/certs/tls.crt", "--key=/certs/tls.key")
8384
volumeMounts = []corev1.VolumeMount{{
84-
Name: "tls-certs",
85+
Name: tlsCertsVolume,
8586
MountPath: "/certs",
8687
ReadOnly: true,
8788
}}
8889
volumes = []corev1.Volume{{
89-
Name: "tls-certs",
90+
Name: tlsCertsVolume,
9091
VolumeSource: corev1.VolumeSource{
9192
Secret: &corev1.SecretVolumeSource{
9293
SecretName: a.TLSSecretName,

test/helpers/deployment.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ func WithTLSCert(dnsNames []string) PatchDeploymentOption {
111111
return err
112112
}
113113

114-
volName := "tls-certs"
115114
dep.Spec.Template.Spec.Volumes = append(dep.Spec.Template.Spec.Volumes,
116115
corev1.Volume{
117-
Name: volName,
116+
Name: tlsCertsVolume,
118117
VolumeSource: corev1.VolumeSource{
119118
Secret: &corev1.SecretVolumeSource{SecretName: certName},
120119
},
@@ -124,7 +123,7 @@ func WithTLSCert(dnsNames []string) PatchDeploymentOption {
124123
dep.Spec.Template.Spec.Containers[i].VolumeMounts = append(
125124
dep.Spec.Template.Spec.Containers[i].VolumeMounts,
126125
corev1.VolumeMount{
127-
Name: volName,
126+
Name: tlsCertsVolume,
128127
MountPath: "/certs",
129128
},
130129
)

tests/helper/helper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"io"
1111
"os"
1212
"os/exec"
13+
"slices"
1314
"strings"
1415
"testing"
1516
"text/template"
@@ -398,8 +399,7 @@ func KubectlDeleteWithTemplate(t *testing.T, data any, templateName, config stri
398399

399400
// Delete templates in reverse order of slice
400401
func KubectlDeleteMultipleWithTemplate(t *testing.T, data any, templates []Template) {
401-
for idx := len(templates) - 1; idx >= 0; idx-- {
402-
tmpl := templates[idx]
402+
for _, tmpl := range slices.Backward(templates) {
403403
KubectlDeleteWithTemplate(t, data, tmpl.Name, tmpl.Config)
404404
}
405405
}

0 commit comments

Comments
 (0)