Skip to content

Commit 22fffe4

Browse files
committed
Use proper linters for Go 1.22
1 parent 905dd2e commit 22fffe4

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ linters:
227227
- bidichk # checks for dangerous unicode character sequences
228228
- bodyclose # checks whether HTTP response body is closed successfully
229229
- canonicalheader # checks whether net/http.Header uses canonical header
230-
# - copyloopvar # detects places where loop variables are copied # disabled bc Go 1.21
230+
- copyloopvar # detects places where loop variables are copied
231231
- cyclop # checks function and package cyclomatic complexity
232232
- dupl # tool for code clone detection
233233
- durationcheck # checks for two durations multiplied together
234234
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
235235
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
236236
- exhaustive # checks exhaustiveness of enum switch statements
237-
- exportloopref # checks for pointers to enclosing loop variables
237+
# - exportloopref # checks for pointers to enclosing loop variables # superseded by copyloopvar in Go 1.22 and higher
238238
- fatcontext # detects nested contexts in loops
239239
- forbidigo # forbids identifiers
240240
- funlen # tool for detection of long functions
@@ -350,4 +350,4 @@ issues:
350350
- goconst
351351
- gosec
352352
- noctx
353-
- wrapcheck
353+
- wrapcheck

goal_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ func TestGoalOk(t *testing.T) {
5050
}
5151

5252
for name, test := range tests {
53-
test := test
5453
ctx, err := ari.NewContext("")
5554
goalCtx := ctx.GoalContext
5655
if err != nil {
@@ -105,7 +104,6 @@ func TestUniversalGoalOk(t *testing.T) {
105104
}
106105

107106
for name, test := range tests {
108-
test := test
109107
ctx, err := ari.NewUniversalContext()
110108
goalCtx := ctx.GoalContext
111109
if err != nil {
@@ -136,7 +134,6 @@ func TestGoalError(t *testing.T) {
136134
},
137135
}
138136
for name, test := range tests {
139-
test := test
140137
ctx, err := ari.NewContext("")
141138
goalCtx := ctx.GoalContext
142139
if err != nil {
@@ -254,7 +251,6 @@ func TestEval(t *testing.T) {
254251
if mt.Fname == "errors.goal" {
255252
continue
256253
}
257-
mt := mt
258254
name := fmt.Sprintf("%s:%d", mt.Fname, mt.Line)
259255
matchString := fmt.Sprintf("(%s) ~ (%s)", mt.Left, mt.Right)
260256
t.Run(name, func(t *testing.T) {
@@ -341,7 +337,6 @@ func TestErrors(t *testing.T) {
341337
t.Fatalf("getScriptMatchTests: %v", err)
342338
}
343339
for _, mt := range append(mts, smts...) {
344-
mt := mt
345340
name := fmt.Sprintf("%s:%d", mt.Fname, mt.Line)
346341
matchString := mt.Left
347342
t.Run(name, func(t *testing.T) {

0 commit comments

Comments
 (0)