mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-24 08:33:41 +01:00
fix: check all Close() return values for errcheck lint
Add explicit error discards (_ =) for Close() calls on network connections, SQL rows, and file handles across 28 files. Also add .golangci.yml with standard linter defaults to match CI configuration.
This commit is contained in:
@@ -60,7 +60,7 @@ func SetupTestDB(t *testing.T) *sqlx.DB {
|
||||
|
||||
// Test connection
|
||||
if err := db.Ping(); err != nil {
|
||||
db.Close()
|
||||
_ = db.Close()
|
||||
t.Skipf("Test database not available: %v. Run: docker compose -f docker/docker-compose.test.yml up -d", err)
|
||||
return nil
|
||||
}
|
||||
@@ -207,7 +207,7 @@ func findProjectRoot(t *testing.T) string {
|
||||
func TeardownTestDB(t *testing.T, db *sqlx.DB) {
|
||||
t.Helper()
|
||||
if db != nil {
|
||||
db.Close()
|
||||
_ = db.Close()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user