Skip to content

Commit 40bfc04

Browse files
committed
CLEANUP/MINOR: lint: fix go 1.24 lint errors
1 parent 9d6f81c commit 40bfc04

308 files changed

Lines changed: 3862 additions & 3863 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.golangci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ linters:
2828
- nlreturn
2929
- ireturn
3030
- interfacebloat
31-
- gomnd
3231
- forcetypeassert
3332
- exhaustruct
3433
- dupword
@@ -38,8 +37,8 @@ linters:
3837
- funlen
3938
- gci
4039
- goconst
41-
- execinquery
42-
- exportloopref
40+
- recvcheck
41+
- tenv #deprecated
4342

4443
issues:
4544
exclude-files:

cmd/struct_equal_generator/test.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ func Test{{$.Name}}{{.}}(t *testing.T) {
88
var result {{$.Name}}
99
err := faker.FakeData(&sample, options.WithIgnoreInterface(true))
1010
if err != nil {
11-
t.Errorf(err.Error())
11+
t.Error(err)
1212
}
1313
byteJSON, err := json.Marshal(sample)
1414
if err != nil {
15-
t.Errorf(err.Error())
15+
t.Error(err)
1616
}
1717
err = json.Unmarshal(byteJSON, &result)
1818
if err != nil {
19-
t.Errorf(err.Error())
19+
t.Error(err)
2020
}
2121

2222
samples = append(samples, struct {
@@ -35,11 +35,11 @@ func Test{{$.Name}}{{.}}(t *testing.T) {
3535
json := jsoniter.ConfigCompatibleWithStandardLibrary
3636
a, err := json.Marshal(&sample.a)
3737
if err != nil {
38-
t.Errorf(err.Error())
38+
t.Error(err)
3939
}
4040
b, err := json.Marshal(&sample.b)
4141
if err != nil {
42-
t.Errorf(err.Error())
42+
t.Error(err)
4343
}
4444
{{- if eq . "Equal" }}
4545
t.Errorf("Expected {{$.Name}} to be equal, but it is not %s %s", a, b)
@@ -63,11 +63,11 @@ func Test{{$.Name}}{{.}}False(t *testing.T) {
6363
var result {{$.Name}}
6464
err := faker.FakeData(&sample, options.WithIgnoreInterface(true))
6565
if err != nil {
66-
t.Errorf(err.Error())
66+
t.Error(err)
6767
}
6868
err = faker.FakeData(&result, options.WithIgnoreInterface(true))
6969
if err != nil {
70-
t.Errorf(err.Error())
70+
t.Error(err)
7171
}
7272
{{- range $.Fields}}
7373
{{- if (eq .Type "bool") }}
@@ -122,11 +122,11 @@ func Test{{$.Name}}{{.}}False(t *testing.T) {
122122
json := jsoniter.ConfigCompatibleWithStandardLibrary
123123
a, err := json.Marshal(&sample.a)
124124
if err != nil {
125-
t.Errorf(err.Error())
125+
t.Error(err)
126126
}
127127
b, err := json.Marshal(&sample.b)
128128
if err != nil {
129-
t.Errorf(err.Error())
129+
t.Error(err)
130130
}
131131
{{- if eq . "Equal" }}
132132
t.Errorf("Expected {{$.Name}} to be different, but it is not %s %s", a, b)

config-parser/generate/config-file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ var testFooter = ` }
355355
buffer.WriteString(config.Config)
356356
p, err := parser.New(options.Reader(&buffer))
357357
if err != nil {
358-
t.Fatalf(err.Error())
358+
t.Fatal(err.Error())
359359
}
360360
result := p.String()
361361
if result != config.Config {
@@ -365,7 +365,7 @@ var testFooter = ` }
365365
t.Error("======== RESULT ===========")
366366
t.Error(result)
367367
t.Error("===========================")
368-
t.Fatalf("configurations does not match")
368+
t.Fatal("configurations does not match")
369369
}
370370
})
371371
}

config-parser/generate/test.tmpl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ func Test{{ $StructName }}{{ .Dir }}(t *testing.T) {
5858
}
5959
if shouldPass {
6060
if err != nil {
61-
t.Errorf(err.Error())
61+
t.Error(err)
6262
return
6363
}
6464
result, err := parser.Result()
6565
if err != nil {
66-
t.Errorf(err.Error())
66+
t.Error(err)
6767
return
6868
}
6969
var returnLine string
@@ -73,15 +73,15 @@ func Test{{ $StructName }}{{ .Dir }}(t *testing.T) {
7373
returnLine = fmt.Sprintf("%s # %s", result[0].Data, result[0].Comment)
7474
}
7575
if command != returnLine {
76-
t.Errorf(fmt.Sprintf("error: has [%s] expects [%s]", returnLine, command))
76+
t.Errorf("error: has [%s] expects [%s]", returnLine, command)
7777
}
7878
} else {
7979
if err == nil {
80-
t.Errorf(fmt.Sprintf("error: did not throw error for line [%s]", line))
80+
t.Errorf("error: did not throw error for line [%s]", line)
8181
}
8282
_, parseErr := parser.Result()
8383
if parseErr == nil {
84-
t.Errorf(fmt.Sprintf("error: did not throw error on result for line [%s]", line))
84+
t.Errorf("error: did not throw error on result for line [%s]", line)
8585
}
8686
}
8787
})
@@ -104,12 +104,12 @@ func Test{{ $StructName }}{{ .Dir }}(t *testing.T) {
104104
err = ProcessLine(line, parser)
105105
}
106106
if err != nil {
107-
t.Errorf(err.Error())
107+
t.Error(err)
108108
return
109109
}
110110
result, err := parser.Result()
111111
if err != nil {
112-
t.Errorf(err.Error())
112+
t.Error(err)
113113
return
114114
}
115115
var returnLine string
@@ -119,7 +119,7 @@ func Test{{ $StructName }}{{ .Dir }}(t *testing.T) {
119119
returnLine = fmt.Sprintf("%s # %s", result[0].Data, result[0].Comment)
120120
}
121121
if expected != returnLine {
122-
t.Errorf(fmt.Sprintf("error: has [%s] expects [%s]", returnLine, expected))
122+
t.Errorf("error: has [%s] expects [%s]", returnLine, expected)
123123
}
124124
})
125125
}
@@ -156,12 +156,12 @@ func TestAlias{{ $StructName }}{{ .Dir }}(t *testing.T) {
156156
}
157157
if shouldPass {
158158
if err != nil {
159-
t.Errorf(err.Error())
159+
t.Error(err)
160160
return
161161
}
162162
result, err := parser.Result()
163163
if err != nil {
164-
t.Errorf(err.Error())
164+
t.Error(err)
165165
return
166166
}
167167
var returnLine string
@@ -171,15 +171,15 @@ func TestAlias{{ $StructName }}{{ .Dir }}(t *testing.T) {
171171
returnLine = fmt.Sprintf("%s # %s", result[0].Data, result[0].Comment)
172172
}
173173
if command != returnLine {
174-
t.Errorf(fmt.Sprintf("error: has [%s] expects [%s]", returnLine, command))
174+
t.Errorf("error: has [%s] expects [%s]", returnLine, command)
175175
}
176176
} else {
177177
if err == nil {
178-
t.Errorf(fmt.Sprintf("error: did not throw error for line [%s]", line))
178+
t.Errorf("error: did not throw error for line [%s]", line)
179179
}
180180
_, parseErr := parser.Result()
181181
if parseErr == nil {
182-
t.Errorf(fmt.Sprintf("error: did not throw error on result for line [%s]", line))
182+
t.Errorf("error: did not throw error on result for line [%s]", line)
183183
}
184184
}
185185
})

config-parser/params/bind-errors.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ package params
1818

1919
import "fmt"
2020

21-
type ErrParseBindOption interface {
21+
type ErrParseBindOption interface { //nolint:iface
2222
Error() string
2323
}
2424

25-
type ErrParseServerOption interface {
25+
type ErrParseServerOption interface { //nolint:iface
2626
Error() string
2727
}
2828

config-parser/params/bind-options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
)
2424

2525
// BindOption ...
26-
type BindOption interface {
26+
type BindOption interface { //nolint:iface
2727
Parse(options []string, currentIndex int) (int, error)
2828
Valid() bool
2929
String() string

config-parser/params/dgram-bind-options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
)
2222

2323
// DgramBindOption ...
24-
type DgramBindOption interface {
24+
type DgramBindOption interface { //nolint:iface
2525
Parse(options []string, currentIndex int) (int, error)
2626
Valid() bool
2727
String() string

config-parser/params/server-options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
)
2323

2424
// ServerOption ...
25-
type ServerOption interface {
25+
type ServerOption interface { //nolint:iface
2626
Parse(options []string, currentIndex int) (int, error)
2727
Valid() bool
2828
String() string

config-parser/spoe/tests/event_generated_test.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-parser/spoe/tests/spoe-section_generated_test.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)