style: check error returns flagged by errcheck linter

golangci-lint's errcheck rule requires explicit handling of error
return values from Close, Write, and Logout calls. Use blank
identifier assignment for cleanup paths where errors are
intentionally discarded.
This commit is contained in:
Houmgaor
2026-02-20 21:22:01 +01:00
parent 458d8c9397
commit e899a2f790
8 changed files with 34 additions and 34 deletions

View File

@@ -24,7 +24,7 @@ func DoEntrance(addr string) ([]ServerEntry, error) {
if err != nil {
return nil, fmt.Errorf("entrance connect: %w", err)
}
defer c.Close()
defer func() { _ = c.Close() }()
// Send a minimal packet (the entrance server reads it, checks len > 5 for USR data).
// An empty/short packet triggers only SV2 response.

View File

@@ -25,7 +25,7 @@ func DoSign(addr, username, password string) (*SignResult, error) {
if err != nil {
return nil, fmt.Errorf("sign connect: %w", err)
}
defer c.Close()
defer func() { _ = c.Close() }()
// Build DSGN request: "DSGN:041" + \x00 + SJIS(user) + \x00 + SJIS(pass) + \x00 + \x00
// The server reads: null-terminated request type, null-terminated user, null-terminated pass, null-terminated unk.