Changelog History
Page 1
-
v1.9.0 Changes
October 28, 2025โ ๐ค AI-Powered Test Generation
โ This release adds AI-powered test case generation using local LLMs via Ollama, enabling automatic generation of intelligent, realistic test cases.
โจ Key Features
- โ ๐ง Intelligent Test Cases : AI analyzes function implementation to generate realistic test values, edge cases, and error conditions
- ๐ Local-First & Private : Uses Ollama to run LLMs locally - your code never leaves your machine
- โก Fast Small Models : Default qwen2.5-coder:0.5b model (400MB) generates tests in seconds
- ๐ฏ Smart Coverage : Automatically identifies edge cases, error conditions, and validation logic
- ๐ง Flexible : Support for simple types, complex types, methods, variadic params, and multiple return values
- ๐ง ๐ Configurable : Adjust min/max test cases, choose different models, or use custom endpoints
๐ Quick Start
# Install Ollama (one-time setup)curl -fsSL https://ollama.com/install.sh|sh ollama serve&ollama pull qwen2.5-coder:0.5b# Generate tests with AIgotests -all -ai -w yourfile.go๐ Example
Given this function:
funcCalculateDiscount(pricefloat64,percentageint) (float64,error) {ifprice\<0{return0,errors.New("price cannot be negative") }ifpercentage\<0||percentage\>100{return0,errors.New("percentage must be between 0 and 100") }returnprice-(price\*float64(percentage)/100.0),nil}AI generates:
- โ โ Valid input test case
- โ Negative price error case
- โ Invalid percentage error case
- โ Proper error handling and assertions
๐ง ๐๏ธ Configuration Options
# Use different modelgotests -all -ai -ai-model llama3.2:latest -w file.go# Generate specific number of test cases (min = max)gotests -all -ai -ai-min-cases 5 -ai-max-cases 5 -w file.go# Generate range of test cases (AI chooses 3-7)gotests -all -ai -ai-min-cases 3 -ai-max-cases 7 -w file.go# Custom Ollama endpointgotests -all -ai -ai-endpoint http://custom:11434 -w file.go๐ ๐ Privacy & Security
- 0๏ธโฃ โ Local-first by default - Using Ollama keeps all data on your machine
- โ Offline operation - Works completely offline with local models
- โ ๏ธ Function bodies are analyzed - Business logic and code comments are sent to the LLM
- ๐ Recommendation : Avoid using
-aion code containing secrets or API keys
โ ๐ Test Coverage Improvements
- Increased overall project coverage from 28.1% to 84.6% (#196)
- โ Added comprehensive tests for:
- internal/goparser package
- internal/models package
- internal/output package
- internal/render package
- gotests/process package
๐ ๐ Documentation Enhancements
- โ Added godoc comments to all exported functions (#195)
- Expanded README with:
- AI-powered test generation section
- Quick start examples
- Privacy and security considerations
- Configuration options and examples
๐ ๏ธ Technical Implementation
๐ New Packages:
internal/ai- AI provider abstraction layer- Ollama provider with health checks and retries
- Go-specific prompt engineering
- Response parsing and validation
- E2E test suite with golden file validation
CLI Flags:
- โ
-ai- Enable AI test case generation - 0๏ธโฃ
-ai-model- Select model (default: qwen2.5-coder:0.5b) - 0๏ธโฃ
-ai-endpoint- Ollama endpoint (default: http://localhost:11434) - โ
-ai-min-cases- Minimum test cases to generate (default: 3) - โ
-ai-max-cases- Maximum test cases to generate (default: 10)
Architecture:
- ๐ Provider-based design for future LLM support
- Language-agnostic core with Go-specific implementation
- Graceful fallback to TODO comments on generation failure
- Integration with existing template rendering pipeline
๐ Known Issues
- โ
Issue #197: 4 out of 11 E2E tests disabled due to environment-dependent LLM non-determinism
- Does not affect functionality, only E2E test validation
- 7 E2E tests pass consistently on first attempt
- Will be addressed in future patch release
๐ฆ Installation
go install github.com/cweill/gotests/gotests@v1.9.0๐ Credits
๐ค Developed with assistance from Claude Code
Full Changelog : v1.8.0...v1.9.0
-
v1.8.0 Changes
October 21, 2025๐ ๐ Full Go Generics Support
๐ This release adds complete support for Go generics (type parameters), enabling
goteststo generate tests for generic functions and methods on generic types.โจ Key Features
๐ง Generic Functions : Generate tests for functions with type parameters
๐๏ธ Generic Types : Support for methods on generic types
๐ฏ All Constraint Types :
any,comparable, union types (int64 | float64), approximation (~int)๐ง Smart Type Mapping : Intelligent defaults for type instantiation
๐ Multiple Type Parameters : Handles functions like
Pair[T, U any]
โ ๐ Test Coverage
- โ 97.5% main package coverage
- โ 83.5% overall project coverage
- โ 100% coverage on all new parser functions
- โ โ 8 comprehensive generic test patterns
๐ง Technical Improvements
๐ Parser Enhancements:
- ๐ New
parseTypeDecls()extracts type parameters from type declarations - ๐ New
parseTypeParams()parses AST field lists - ๐ New
extractBaseTypeName()handles receiver types
Template Functions:
TypeArgs- generates concrete type arguments for callsFieldType- substitutes type parameters in field declarationsReceiverType- substitutes type parameters in receiver instantiations
โก๏ธ Model Updates:
- ๐ New
TypeParamstruct - โ Added
TypeParamsfield toFunction - Helper methods:
IsGeneric(),HasGenericReceiver()
๐ ๐ Documentation
โ Added comprehensive "Go Generics Support" section to README with:
- โ Example: Generic function test generation
- Example: Methods on generic types
- Type constraint mapping reference
๐ ๐ Fixes
โ Closes #165
๐ฆ Installation
go install github.com/cweill/gotests/gotests@v1.8.0๐ Credits
๐ค Developed with assistance from Claude Code
Full Changelog : v1.7.0...v1.8.0
-
v1.7.4 Changes
October 21, 2025What'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!ifgot!=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}iftt.wantErr{return// โ Fixed: Skip result checks when error expected}ifgot!=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_paramsflag 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.4Full Changelog : v1.7.3...v1.7.4
-
v1.7.3 Changes
October 21, 2025What'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/toolsfrom v0.0.0-20191109212701 (November 2019) to v0.38.0 (latest) to address multiple security vulnerabilities:- CVE-2021-38561 - Fixed
- CVE-2019-9512 - Fixed
- CVE-2020-29652 - Fixed
๐ Changes
- โก๏ธ Updated
golang.org/x/toolsfrom 2019 version to v0.38.0 - โก๏ธ Updated Go directive to 1.24.0 (with toolchain go1.24.5)
- โ Added indirect dependencies:
golang.org/x/modv0.29.0,golang.org/x/syncv0.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.3Important Note
โก๏ธ We recommend all users update to this version to ensure you have the latest security fixes.
Full Changelog : v1.7.2...v1.7.3
๐ Thanks to @testwill for identifying these security vulnerabilities!
-
v1.7.2 Changes
October 21, 2025What'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.2Full Changelog : v1.7.1...v1.7.2
- โ Remove unnecessary type conversion (#170) - Simplified code in
-
v1.7.1 Changes
October 21, 2025What'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.DeepEqualfor better test assertions and diff output.$ gotests -use_go_cmp -all -w example.goโ Generated tests will use
cmp.Equal()for comparisons andcmp.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.1Full Changelog : v1.7.0...v1.7.1
-
v1.7.0 Changes
October 21, 2025๐ 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
pkgdirectory and its subdirectories. Fixes #186.Cleaner Generated Code
โ Generated tests now use Go 1.22+ loop variable scoping, eliminating the need for the
tt := ttshadowing pattern. Tests are now cleaner and more readable.๐ Better Error Handling
โ Subtests with return values now use
t.Fatalf()instead oft.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.
-
v1.6.0
December 26, 2020 -
v1.5.3
April 07, 2019 -
v1.5.2
November 08, 2016