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:
2026-03-27 13:30:43 -07:00
parent 4f3249fdc3
commit a60e5cb86a
28 changed files with 343 additions and 354 deletions

View File

@@ -40,7 +40,7 @@ func serverCmd() *cobra.Command {
if err != nil {
return fmt.Errorf("opening database: %w", err)
}
defer store.Close()
defer func() { _ = store.Close() }()
if err := store.Migrate(); err != nil {
return fmt.Errorf("running migrations: %w", err)
@@ -93,7 +93,7 @@ func serverCmd() *cobra.Command {
}()
defer func() {
grpcSrv.GracefulStop()
os.Remove(cfg.GRPC.SocketPath())
_ = os.Remove(cfg.GRPC.SocketPath())
}()
}

View File

@@ -32,7 +32,7 @@ func snapshotCmd() *cobra.Command {
if err != nil {
return fmt.Errorf("opening database: %w", err)
}
defer store.Close()
defer func() { _ = store.Close() }()
dataDir := filepath.Dir(cfg.Database.Path)

View File

@@ -33,7 +33,7 @@ func statusCmd() *cobra.Command {
if err != nil {
return fmt.Errorf("connecting to gRPC API: %w", err)
}
defer conn.Close()
defer func() { _ = conn.Close() }()
client := pb.NewProxyAdminServiceClient(conn)