Fix golangci-lint v2 compliance, make all passes clean
- Fix 314 errcheck violations (blank identifier for unrecoverable errors) - Fix errorlint violation (errors.Is for io.EOF) - Remove unused serveL7Route test helper - Simplify Duration.Seconds() selectors in tests - Remove unnecessary fmt.Sprintf in test - Migrate exclusion rules from issues.exclusions to linters.exclusions (v2 schema) - Add gosec test exclusions (G115, G304, G402, G705) - Disable fieldalignment govet analyzer (optimization, not correctness) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ func setup(t *testing.T) *testEnv {
|
||||
if err != nil {
|
||||
t.Fatalf("open db: %v", err)
|
||||
}
|
||||
t.Cleanup(func() { store.Close() })
|
||||
t.Cleanup(func() { _ = store.Close() })
|
||||
|
||||
if err := store.Migrate(); err != nil {
|
||||
t.Fatalf("migrate: %v", err)
|
||||
@@ -130,7 +130,7 @@ func setup(t *testing.T) *testEnv {
|
||||
if err != nil {
|
||||
t.Fatalf("dial bufconn: %v", err)
|
||||
}
|
||||
t.Cleanup(func() { conn.Close() })
|
||||
t.Cleanup(func() { _ = conn.Close() })
|
||||
|
||||
return &testEnv{
|
||||
client: pb.NewProxyAdminServiceClient(conn),
|
||||
@@ -775,7 +775,7 @@ func TestRemoveL7Policy(t *testing.T) {
|
||||
env := setup(t)
|
||||
ctx := context.Background()
|
||||
|
||||
env.client.AddL7Policy(ctx, &pb.AddL7PolicyRequest{
|
||||
_, _ = env.client.AddL7Policy(ctx, &pb.AddL7PolicyRequest{
|
||||
ListenerAddr: ":443",
|
||||
Hostname: "a.test",
|
||||
Policy: &pb.L7Policy{Type: "require_header", Value: "X-Token"},
|
||||
|
||||
Reference in New Issue
Block a user