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:
Houmgaor
2026-02-17 23:57:14 +01:00
parent abb40f163c
commit c64dabc3ba
29 changed files with 61 additions and 53 deletions

View File

@@ -434,7 +434,7 @@ func TestServerHandleConnection(t *testing.T) {
if err != nil {
t.Fatalf("Dial() error: %v", err)
}
defer conn.Close()
defer func() { _ = conn.Close() }()
nullInit := make([]byte, 8)
_, err = conn.Write(nullInit)
@@ -472,7 +472,7 @@ func TestServerHandleConnectionWithShortInit(t *testing.T) {
}
_, _ = conn.Write([]byte{0, 0, 0, 0})
conn.Close()
_ = conn.Close()
time.Sleep(50 * time.Millisecond)
}
@@ -502,7 +502,7 @@ func TestServerHandleConnectionImmediateClose(t *testing.T) {
if err != nil {
t.Fatalf("Dial() error: %v", err)
}
conn.Close()
_ = conn.Close()
time.Sleep(50 * time.Millisecond)
}
@@ -544,7 +544,7 @@ func TestServerMultipleConnections(t *testing.T) {
time.Sleep(50 * time.Millisecond)
for _, conn := range conns {
conn.Close()
_ = conn.Close()
}
}