mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
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:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user