fix(test): check errors instead of discarding with bare _ #152

Merged
lerko merged 1 commits from fix/bare-errors-in-tests into main 2026-06-27 15:57:35 +00:00
Owner

Summary

  • Replace bare _ error discards with t.Fatalf checks across 4 test files
  • sqlstore_test.go — 4 fixes (GetSites, LoadAllHistory, GetStateChanges, GetActiveMaintenanceWindows)
  • crypto_test.go — 2 fixes (Encrypt calls)
  • server_test.go — 10 fixes (net.Listen, json.Marshal, http.NewRequest)
  • checker_test.go — 10 fixes (net.SplitHostPort, strconv.Atoi)

Not changed

  • monitor_test.go — discards are bool/int64 returns, not errors
  • update_test.go — discards are tea.Cmd returns, not errors

Test plan

  • go test ./... all green
  • golangci-lint run ./... 0 issues
  • grep confirms zero bare _ error discards remain in fixed files
## Summary - Replace bare `_` error discards with `t.Fatalf` checks across 4 test files - `sqlstore_test.go` — 4 fixes (GetSites, LoadAllHistory, GetStateChanges, GetActiveMaintenanceWindows) - `crypto_test.go` — 2 fixes (Encrypt calls) - `server_test.go` — 10 fixes (net.Listen, json.Marshal, http.NewRequest) - `checker_test.go` — 10 fixes (net.SplitHostPort, strconv.Atoi) ## Not changed - `monitor_test.go` — discards are `bool`/`int64` returns, not errors - `update_test.go` — discards are `tea.Cmd` returns, not errors ## Test plan - [x] `go test ./...` all green - [x] `golangci-lint run ./...` 0 issues - [x] `grep` confirms zero bare `_` error discards remain in fixed files
lerko added 1 commit 2026-06-27 15:53:23 +00:00
fix(test): check errors instead of discarding with bare _
CI / test (pull_request) Successful in 1m53s
CI / lint (pull_request) Successful in 1m16s
CI / vulncheck (pull_request) Successful in 56s
edbc2beddd
Replace bare _ error discards with t.Fatalf checks across
sqlstore_test, crypto_test, server_test, and checker_test.
lerko merged commit edbc2beddd into main 2026-06-27 15:57:35 +00:00
lerko deleted branch fix/bare-errors-in-tests 2026-06-27 15:57:35 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lerkolabs/uptop#152