chore: deprecate Go 1.24 support
Summary
Handle errors idiomatically in examples and tests using explicit //nolint:errcheck directives instead of assigning to _.
What Changed
This MR addresses feedback that the linter fixes should use Go's standard practice of documenting deliberately ignored errors:
-
Defer cleanup operations — simplified from
defer func() { _ = obj.Close() }()to idiomaticdefer obj.Close(). Added//nolint:errcheckto explicitly document error suppression. -
fmt.Print to ResponseWriter — removed
_, _ =assignments and added//nolint:errcheckto show we're aware of and deliberately ignoring write errors (conventional in test/example code). -
fmt.Fprintf/Fprintln to stdout/stderr — added
//nolint:errcheckto CLI utility output operations where errors can be safely ignored. -
Error checking before defer — moved error checks before defer statements per staticcheck SA5001 (don't defer cleanup of a resource if initialization can fail).
-
Example code error handling — added proper error checking for operations that can fail (
http.ListenAndServe,server.Serve).
Why
Using //nolint:errcheck is more explicit than assigning to _:
- Documents that we're aware the operation returns an error
- Shows the decision to ignore it is intentional
- Satisfies linters while keeping code readable
- Aligns with Go idiom for test/example code
Test Plan
- All tests passing (
go test ./...in both root and v2) - All linters passing (0 issues, both modules)
- No errcheck violations remaining
- Pre-push hooks passing