Skip to content

chore: add Go linters and migrate tests to testify - #3

Merged
brawler2011 merged 2 commits into
mainfrom
chore/go-lint-testify
Oct 15, 2026
Merged

brawler2011 merged 2 commits into
mainfrom
chore/go-lint-testify

Conversation

@brawler2011

Copy link
Copy Markdown
Owner

Adds a shared Go lint gate to catch errors and outdated code in local checks, CI, and releases. make lint runs golangci-lint v2 with the standard checks plus modernize, testifylint, bodyclose, and errorlint; workflows install pinned v2.13.2.

Migrates existing tests to testify/assert and testify/require, uses testing-managed temporary directories and environment cleanup, and fixes the enabled linters' findings. CLI list output and HWID persistence now return write errors; wrapped process errors preserve their causes. Numeric parsing retains its existing defaults for invalid optional fields.

Validation:

  • make check on Go 1.26.4 and Go 1.27.1: no lint issues, all tests pass.
  • make build: passes.
  • git diff --check: passes.

@brawler2011 brawler2011 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete diff, including the lint gate, CI/release integration, production autofixes, and all seven migrated test files. No blocking findings.

Checked that all build/test/lint targets use the same feature tags, the pinned linter supports the project's Go version, compound test assertions retain their checks, pointer/slice prerequisites stop tests before dependent access, and assertions in worker goroutines remain non-fatal. Cleanup, optional numeric parsing defaults, and process error wrapping were also reviewed.

Validation: make check passed on Go 1.26.4 and Go 1.27.1 (zero lint issues and all tests passing); make build and git diff --check passed. GitHub CI will be checked before merging.

This is the implementing agent's own review, not an independent reviewer approval.

@brawler2011 brawler2011 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final self-review found one test-equivalence issue and fixed it: assert.NoFileExists also accepts directories and arbitrary stat errors. The cleanup test now checks os.Stat with require.ErrorIs(err, fs.ErrNotExist), retaining the original strict requirement that the temporary config is absent.

After the correction, GOTOOLCHAIN=go1.26.4 make check passes again with zero lint issues and all tests passing. No remaining blocking findings. This is the implementing agent's self-review; CI for the final commit is still required before merging.

@brawler2011
brawler2011 merged commit d92a29e into main Oct 15, 2026
2 checks passed
@brawler2011
brawler2011 deleted the chore/go-lint-testify branch October 15, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant