What's New in v1.7.1
This release adds two highly-requested features to improve the gotests experience.
New Features
๐งช go-cmp Support (-use_go_cmp
)
Generate tests using google/go-cmp instead of reflect.DeepEqual
for better test assertions and diff output.
$ gotests -use_go_cmp -all -w example.go
Generated tests will use cmp.Equal()
for comparisons and cmp.Diff()
in error messages, providing much clearer output when tests fail.
Example output:
if !cmp.Equal(tt.want, got) {
t.Errorf("Foo() = %v, want %v\ndiff=%s", got, tt.want, cmp.Diff(tt.want, got))
}
Resolves #155 (thanks to @butuzov for the original PR!)
๐ Version Information (-version
)
Check which version of gotests you're running:
$ gotests -version
gotests v1.7.1
Go version: go1.22.0
Git commit: 5252e0b...
Build time: 2025-10-21T02:15:00Z
This helps with troubleshooting and verifying you have the latest release.
Resolves #133
Housekeeping
Installation
go install github.com/cweill/gotests/gotests@v1.7.1
Full Changelog: v1.7.0...v1.7.1