Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use .Fatalf instead of .Errorf and return in function.tmpl#184

Closed
JeffFaer wants to merge 2 commits intocweill:developfrom
JeffFaer:patch-1
Closed

Use .Fatalf instead of .Errorf and return in function.tmpl#184
JeffFaer wants to merge 2 commits intocweill:developfrom
JeffFaer:patch-1

Conversation

@JeffFaer
Copy link

@JeffFaer JeffFaer commented Aug 2, 2023

The IntelliJ go plugin uses this library to generate test cases. This is one of my (relatively minor) annoyances. It tends to come up a lot in code reviews when I forget/don't change it to be Fatalf instead of Errorf; return

cweill added a commit that referenced this pull request Oct 21, 2025
This commit integrates improvements from several pending PRs and addresses
key user feedback:

## Template Improvements (PR #184)
- Use t.Fatalf() instead of t.Errorf() + return in subtests
- Improves test ergonomics and reduces boilerplate
- Updated golden test files to reflect new behavior

## Documentation Updates (PR #185, #180)
- Document the -named flag for map-based table tests
- Update installation from go get to go install (go get deprecated)
- Update minimum Go version to 1.16

## Use stdlib embed (PR #181)
- Replace esc/go-bindata with Go 1.16+ embed package
- Removes 834+ lines of generated code and 3rd party dependencies
- Simplifies template loading and reduces maintenance burden
- Convert symlinks in testify templates to real files for embed compatibility

Breaking Changes:
- Minimum Go version bumped from 1.6 to 1.16 (for embed support)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
cweill added a commit that referenced this pull request Oct 21, 2025
This commit integrates improvements from several pending PRs and addresses
key user feedback:

## Template Improvements (PR #184)
- Use t.Fatalf() instead of t.Errorf() + return in subtests
- Improves test ergonomics and reduces boilerplate
- Updated golden test files to reflect new behavior

## Documentation Updates (PR #185, #180)
- Document the -named flag for map-based table tests
- Update installation from go get to go install (go get deprecated)
- Update minimum Go version to 1.16

## Use stdlib embed (PR #181)
- Replace esc/go-bindata with Go 1.16+ embed package
- Removes 834+ lines of generated code and 3rd party dependencies
- Simplifies template loading and reduces maintenance burden
- Convert symlinks in testify templates to real files for embed compatibility

Breaking Changes:
- Minimum Go version bumped from 1.6 to 1.16 (for embed support)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@cweill
Copy link
Owner

cweill commented Oct 21, 2025

Thank you so much for this PR! 🎉

This improvement has been integrated into v1.7.0. Generated tests now use t.Fatalf() instead of t.Errorf() + return in subtests with return values, providing clearer test failure semantics.

Your contribution is part of the modernization effort that brought gotests back to life after 5 years. Really appreciate your patience and the quality of this PR!

Check out the release: https://github.com/cweill/gotests/releases/tag/v1.7.0

@cweill cweill closed this Oct 21, 2025
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.

2 participants