All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.8.0 - 2025-10-21
- Full Go Generics Support (fixes #165)
- Generate tests for generic functions with type parameters (
func Foo[T any](val T) T) - Support for all constraint types:
any,comparable, union types (int64 | float64), approximation constraints (~int) - Generate tests for methods on generic types (
func (s *Set[T]) Add(v T)) - Support for multiple type parameters (
func Pair[T, U any](first T, second U)) - Smart type parameter substitution throughout generated tests
- Intelligent constraint-to-concrete-type mapping:
any→int(simple value type)comparable→string(commonly comparable type)- Union types → first option (e.g.,
int64 | float64→int64) - Approximation constraints → underlying type (e.g.,
~int→int)
- Support for generic receiver types with proper type argument instantiation
- Test names automatically strip type parameters (e.g.,
Set[T].Add→TestSet_Add)
- Generate tests for generic functions with type parameters (
- Improved type constraint analysis in parser
- Extracts type parameters from both function signatures and type declarations
- Resolves type parameters for methods on generic types
- Enhanced template rendering with type substitution helpers
TypeArgs- generates concrete type arguments for generic function callsFieldType- substitutes type parameters in field type declarationsReceiverType- substitutes type parameters in receiver instantiations
- Parser enhancements in
internal/goparser/goparser.go:- New
parseTypeDecls()extracts type parameters from type declarations - New
parseTypeParams()parses AST field lists for type parameters - New
extractBaseTypeName()strips type parameters from receiver types
- New
- Model updates in
internal/models/models.go:- New
TypeParamstruct with Name and Constraint fields - Added
TypeParamsfield toFunctionstruct - New helper methods:
IsGeneric(),HasGenericReceiver(),TypeParamMapping()
- New
- Render improvements in
internal/render/:- New template functions for type substitution
- Smart constraint-to-type mapping with support for numeric constraints
- Proper handling of generic receiver instantiation
- 97.5% main package coverage (all tests passing)
- 83.5% overall project coverage
- 100% coverage on all new parser functions
- Comprehensive test suite with 8 generic patterns:
- Generic functions with
anyconstraint - Generic functions with
comparableconstraint - Union type constraints
- Multiple type parameters
- Mixed generic/non-generic parameters
- Generic functions returning errors
- Methods on single-parameter generic types (
Set[T]) - Methods on multi-parameter generic types (
Map[K,V])
- Generic functions with
1.7.0 - 2025-10-20
- Recursive directory support: You can now use patterns like
pkg/...to generate tests for all Go files in a directory tree (fixes #186) - Documentation for the
-namedflag in README (PR #185) - CLAUDE.md for AI-assisted development context
t.Parallel()at the top-level test function when-parallelflag is used (fixes #188)
- BREAKING: Minimum Go version increased from 1.6 to 1.22
- Leverages Go 1.22's per-iteration loop variable scoping
- Removes unnecessary
tt := ttandname := nameshadowing in generated tests - Cleaner, more modern generated test code
- Template Error Handling: Use
t.Fatalf()instead oft.Errorf() + returnin subtests with return values (PR #184)- Better test ergonomics and clearer failure semantics
- Prevents misleading test output when errors occur
- Dependencies: 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 dependencies
- Installation: Updated README to use
go installinstead of deprecatedgo get(PR #180) - CI/CD: Updated GitHub Actions workflow
- Now tests only Go 1.22.x and 1.23.x (down from 8 versions)
- Updated actions/setup-go v2→v5
- Updated actions/checkout v2→v4
- Simplified coverage reporting with coverallsapp/github-action@v2
- Import Path Bug: Fixed missing import paths when receiver types and methods are defined in different files (PR #179)
- Now correctly collects imports from all files in the package
- Prevents compilation errors in generated test files
- t.Parallel() Placement: Moved
t.Parallel()to the correct location at the top of test functions- Satisfies
tparallellinter requirements - Ensures proper parallel test execution
- Satisfies
- Support for Go versions older than 1.22
- Bindata dependency (go-bindata, esc) in favor of stdlib embed
- Unnecessary loop variable shadowing in generated tests
1.6.0 - 2020-XX-XX
Previous release (pre-changelog).