chore: bump golangci-lint and fix all linting issues (#21761)

This commit is contained in:
Julien Robert
2024-09-16 19:11:19 +00:00
committed by GitHub
parent 52ba264c80
commit cbdfd9bdfa
186 changed files with 114 additions and 455 deletions
+1 -1
View File
@@ -139,7 +139,7 @@ func ListenerMux(listeners ...Listener) Listener {
mux.onBatch = func(batch PacketBatch) error {
for _, listener := range listeners {
err := batch.apply(&listener)
err := batch.apply(&listener) //nolint:gosec // aliasing is safe here
if err != nil {
return err
}
+2
View File
@@ -332,6 +332,8 @@ func TestCompareModuleSchemas(t *testing.T) {
}
func requireModuleSchema(t *testing.T, types ...schema.Type) schema.ModuleSchema {
t.Helper()
s, err := schema.CompileModuleSchema(types...)
if err != nil {
t.Fatal(err)
+1 -1
View File
@@ -75,7 +75,7 @@ func (c Field) ValidateValue(value interface{}, typeSet TypeSet) error {
}
err := enumType.ValidateValue(value.(string))
if err != nil {
return fmt.Errorf("invalid value for enum field %q: %v", c.Name, err)
return fmt.Errorf("invalid value for enum field %q: %v", c.Name, err) //nolint:errorlint // false positive due to using go1.12
}
default:
}
+1 -1
View File
@@ -24,7 +24,7 @@ func TestAppSimulator_mirror(t *testing.T) {
})
}
func testAppSimulatorMirror(t *testing.T, retainDeletes bool) { // nolint: thelper // this isn't a test helper function
func testAppSimulatorMirror(t *testing.T, retainDeletes bool) { //nolint: thelper // this isn't a test helper function
stateSimOpts := statesim.Options{CanRetainDeletions: retainDeletes}
mirror, err := NewSimulator(Options{
StateSimOptions: stateSimOpts,