Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Oct 24, 2025

This PR contains the following updates:

Package Change Age Confidence
github.com/cweill/gotests v1.6.0 -> v1.7.4 age confidence

Release Notes

cweill/gotests (github.com/cweill/gotests)

v1.7.4

Compare Source

What's New in v1.7.4

This release fixes two important bugs that improve test correctness and restore broken functionality.

Bug Fixes
🐛 Fixed wantErr Test Logic (PR #​169)

When a test expects an error (tt.wantErr == true), gotests now correctly skips result validation instead of checking potentially undefined return values.

Before:

if (err != nil) != tt.wantErr {
    t.Errorf("Foo() error = %v, wantErr %v", err, tt.wantErr)
    continue
}
// Bug: Still checks results even when error is expected!
if got != tt.want {
    t.Errorf("Foo() = %v, want %v", got, tt.want)
}

After:

if (err != nil) != tt.wantErr {
    t.Errorf("Foo() error = %v, wantErr %v", err, tt.wantErr)
    continue
}
if tt.wantErr {
    return  // ← Fixed: Skip result checks when error expected
}
if got != tt.want {
    t.Errorf("Foo() = %v, want %v", got, tt.want)
}

This prevents false test failures and ensures tests behave correctly when expecting errors.

Thanks to @​arifmahmudrana for identifying this issue!

🐛 Fixed -template_params Flag (Issue #​149)

The -template_params flag was defined but never actually used due to a bug from PR #​90. This flag now works correctly!

Usage:

### Pass template parameters as JSON string
$ gotests -template_params '{"key":"value"}' -all file.go

### Or use a file (takes precedence)
$ gotests -template_params_file params.json -all file.go

This is useful when calling gotests from other tools with custom templates.

Thanks to @​butuzov for identifying this bug and @​cweill for the fix suggestion!

Installation
go install github.com/cweill/gotests/gotests@v1.7.4

Full Changelog: cweill/gotests@v1.7.3...v1.7.4

v1.7.3

Compare Source

What's New in v1.7.3

This is a security update that addresses multiple CVEs by updating dependencies.

Security Fixes
🔒 Updated golang.org/x/tools to fix CVEs

Updated golang.org/x/tools from v0.0.0-20191109212701 (November 2019) to v0.38.0 (latest) to address multiple security vulnerabilities:

Changes
  • Updated golang.org/x/tools from 2019 version to v0.38.0
  • Updated Go directive to 1.24.0 (with toolchain go1.24.5)
  • Added indirect dependencies: golang.org/x/mod v0.29.0, golang.org/x/sync v0.17.0
  • Fixed test code compatibility with stricter format string checking in newer x/tools

All tests pass with the updated dependencies.

Installation
go install github.com/cweill/gotests/gotests@v1.7.3
Important Note

We recommend all users update to this version to ensure you have the latest security fixes.

Full Changelog: cweill/gotests@v1.7.2...v1.7.3


Thanks to @​testwill for identifying these security vulnerabilities!

v1.7.2

Compare Source

What's New in v1.7.2

This is a small cleanup release with code quality improvements and documentation updates.

Improvements
🧹 Code Cleanup
  • Remove unnecessary type conversion (#​170) - Simplified code in generateTest() by removing redundant type conversion. Thanks to @​fengxuway!
📚 Documentation
  • Update VS Code link (#​167) - Changed Visual Studio Code link to point directly to gotests-specific configuration documentation for easier setup. Thanks to @​davidhsingyuchen!
Installation
go install github.com/cweill/gotests/gotests@v1.7.2

Full Changelog: cweill/gotests@v1.7.1...v1.7.2

v1.7.1

Compare Source

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
  • Closed superseded README PRs (#​172, #​166) that were already addressed in v1.7.0
Installation
go install github.com/cweill/gotests/gotests@v1.7.1

Full Changelog: cweill/gotests@v1.7.0...v1.7.1

v1.7.0: - Major Modernization Release

Compare Source

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 embed package (PR #​181)
  • Removed 834+ lines of generated code
  • Simplified build process - no more go generate needed
  • 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 tparallel linter requirements
  • Better parallel test execution
Documentation & Installation
  • Updated README to use go install instead of deprecated go get (PR #​180)
  • Documented the -named flag 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:

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.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
Copy link
Contributor Author

renovate bot commented Oct 24, 2025

ℹ Artifact update notice

File name: scripts/dofy/go.mod

In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):

  • 4 additional dependencies were updated

Details:

Package Change
golang.org/x/mod v0.27.0 -> v0.29.0
golang.org/x/sync v0.16.0 -> v0.17.0
golang.org/x/sys v0.35.0 -> v0.37.0
golang.org/x/tools v0.36.0 -> v0.38.0

@renovate renovate bot enabled auto-merge (squash) October 24, 2025 04:27
@renovate renovate bot merged commit 298b852 into main Oct 24, 2025
10 of 11 checks passed
@renovate renovate bot deleted the renovate/github.com-cweill-gotests-1.x branch October 24, 2025 04:28
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