v1.7.0 - Major Modernization Release
v1.7.0 - Major Modernization Release
After 5 years since v1.6.0, we're excited to release v1.7.0 with major improvements and modernizations! π
β¨ New Features
Recursive Directory Support
You can now generate tests for entire directory trees using the ... pattern:
gotests -all pkg/...This will recursively generate tests for all Go files in the pkg directory and its subdirectories. Fixes #186.
Cleaner Generated Code
Generated tests now use Go 1.22+ loop variable scoping, eliminating the need for the tt := tt shadowing pattern. Tests are now cleaner and more readable.
Better Error Handling
Subtests with return values now use t.Fatalf() instead of t.Errorf() + return, providing clearer test failure semantics and preventing misleading output. Thanks to PR #184.
π§ Improvements
BREAKING: Minimum Go Version
- Minimum Go version increased from 1.6 to 1.22
- Leverages modern Go features for cleaner generated code
- Aligns with Go's official support policy
Dependency Reduction
- Replaced third-party bindata tools with stdlib
embedpackage (PR #181) - Removed 834+ lines of generated code
- Simplified build process - no more
go generateneeded - Better maintainability and reduced external dependencies
Bug Fixes
- Fixed import path bug when receiver types and methods are in different files (PR #179)
- Now correctly collects imports from all files in the package
- Prevents compilation errors in generated test files
Template Improvements
- Proper
t.Parallel()placement at top-level test functions (fixes #188) - Satisfies
tparallellinter requirements - Better parallel test execution
Documentation & Installation
- Updated README to use
go installinstead of deprecatedgo get(PR #180) - Documented the
-namedflag for map-based table tests (PR #185) - Added CHANGELOG.md for tracking changes
- Added CLAUDE.md for AI-assisted development
π¦ CI/CD Updates
- Updated GitHub Actions to test Go 1.22.x, 1.23.x, 1.24.x, and 1.25.x
- Modernized actions: setup-go v2βv5, checkout v2βv4
- Simplified coverage reporting with coverallsapp/github-action@v2
- Fixed bot commit support for automated workflows
π Statistics
- 834+ lines of generated bindata code removed
- 5 PRs integrated
- 2 issues fixed
- 4 Go versions tested in CI (was 8, now focused on recent versions)
π Thanks
Special thanks to the contributors whose PRs were integrated in this release:
- PR #184 (t.Fatalf improvement)
- PR #185 (documentation)
- PR #180 (go install)
- PR #181 (embed package)
- PR #179 (import fix)
And to everyone who reported issues and helped maintain this project!
π Installation
go install github.com/cweill/gotests/gotests@latestπ Full Changelog
See CHANGELOG.md for complete details.