fix(channelserver): resolve all golangci-lint issues and add handler tests

Fix errcheck violations across 11 repo files by wrapping deferred
rows.Close() and tx.Rollback() calls to discard the error return.
Fix unchecked Scan/Exec calls in guild store tests. Fix staticcheck
SA9003 empty branch in test helpers.

Add 6 mock-based unit tests for GetCharacterSaveData covering nil
savedata, sql.ErrNoRows, DB errors, compressed round-trip,
new-character skip, and config mode/pointer propagation.
This commit is contained in:
Houmgaor
2026-02-21 14:47:25 +01:00
parent bd8e30d570
commit 35d8471d59
13 changed files with 280 additions and 59 deletions

View File

@@ -33,7 +33,7 @@ func (r *DistributionRepository) List(charID uint32, distType uint8) ([]Distribu
if err != nil {
return nil, err
}
defer rows.Close()
defer func() { _ = rows.Close() }()
var dists []Distribution
for rows.Next() {
@@ -52,7 +52,7 @@ func (r *DistributionRepository) GetItems(distributionID uint32) ([]Distribution
if err != nil {
return nil, err
}
defer rows.Close()
defer func() { _ = rows.Close() }()
var items []DistributionItem
for rows.Next() {