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:

  1. Defer cleanup operations — simplified from defer func() { _ = obj.Close() }() to idiomatic defer obj.Close(). Added //nolint:errcheck to explicitly document error suppression.

  2. fmt.Print to ResponseWriter — removed _, _ = assignments and added //nolint:errcheck to show we're aware of and deliberately ignoring write errors (conventional in test/example code).

  3. fmt.Fprintf/Fprintln to stdout/stderr — added //nolint:errcheck to CLI utility output operations where errors can be safely ignored.

  4. Error checking before defer — moved error checks before defer statements per staticcheck SA5001 (don't defer cleanup of a resource if initialization can fail).

  5. 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
Edited by Elliot Forbes

Merge request reports

Loading
Loading