What changed in mockery from 2 to 3
9 releases numbered after v2.53.8 up to and including v3.9.0, stable releases only. v2.53.8 and v3.9.0 are the newest stable releases of 2 and 3 we track; this page follows them as new ones ship.
30 changes across 9 releases
- Document migration from v2 directory-based commands
- Add memprofile option
- Add resolve-internal-aliases option to render public aliases of internal types
- Add cpuprofile option
- Support embedded types in matryer mocks
- Add goimports configuration options
- Support for Go 1.26 in mockery v3
- Let generate: false exclude an interface even when all: true is set
- Allow replace-type to cascade from parent configs
- Updated dependencies used for licensing
- FAQ now highlights that package path errors can be caused by a case mismatch
- Updated documentation of the InterfaceFile template data
- Replaced the old 'interface{}' syntax with 'any' in generated code
- Update example
- Refactor name suggestion logic in method_scope.go
- Basic documentation updates
- Report PackagePath and MockName template variables during migration
- Carry v2 profile option over to cpuprofile during migration
- Honor interface-level skip-ensure imports in the matryer generator
- Bump golang.org/x/tools to v0.51.0 to support Go 1.27.2 export data
- Clarify how to upgrade mockery with Go releases in the documentation
- Report unparsable exclude-subpkg-regex instead of panicking
- Mark testify mock constructors and cleanup as helpers
- Bumped golang.org/x/tools to v0.49.0 to add Go 1.27 support
- Upgraded CI configuration for Go 1.27
- Avoided in-package import collisions with package-scope declarations in v3
- Corrected typos in comments and documentation
- Matching now treats interface{} the same as any
- Fixed a file descriptor leak caused by a defer statement inside a loop in cmd
- Fixed an error with InterfaceDirRelative when using external paths
Original release notes, newest first
The list above is our reading of these notes; the originals from Vektra are here, one fold per release.
v3.9.0
What's Changed
- Document migration from v2 directory-based commands by @ac1982 in https://github.com/vektra/mockery/pull/1190
- fix(migrate): report PackagePath and MockName template variables by @ybai08 in https://github.com/vektra/mockery/pull/1194
- Let
generate: falseexclude an interface even whenall: trueby @thespags in https://github.com/vektra/mockery/pull/1199 - Allow replace-type to cascade from parent configs by @thespags in https://github.com/vektra/mockery/pull/1197
- fix(migrate): carry v2
profileover tocpuprofileby @ybai08 in https://github.com/vektra/mockery/pull/1195 - v3: add memprofile option by @ybai08 in https://github.com/vektra/mockery/pull/1200
- Add resolve-internal-aliases to render public aliases of internal types by @thespags in https://github.com/vektra/mockery/pull/1198
New Contributors
- @ac1982 made their first contribution in https://github.com/vektra/mockery/pull/1190
- @ybai08 made their first contribution in https://github.com/vektra/mockery/pull/1194
- @thespags made their first contribution in https://github.com/vektra/mockery/pull/1199
Full Changelog: https://github.com/vektra/mockery/compare/v3.8.1...v3.9.0
v3.8.1
What's Changed
- fix(matryer): honor interface-level skip-ensure imports by @fzlzjerry in https://github.com/vektra/mockery/pull/1185
- fix: bump golang.org/x/tools to v0.51.0 for Go 1.27.2 export data by @shuhrat-shokirov in https://github.com/vektra/mockery/pull/1188
New Contributors
- @fzlzjerry made their first contribution in https://github.com/vektra/mockery/pull/1185
- @shuhrat-shokirov made their first contribution in https://github.com/vektra/mockery/pull/1188
Full Changelog: https://github.com/vektra/mockery/compare/v3.8.0...v3.8.1
v3.8.0
What's Changed
- fix(docs): Clarify how to upgrade mockery with Go releases by @LandonTClipp in https://github.com/vektra/mockery/pull/1175
- fix: report unparsable
exclude-subpkg-regexinstead of panicking by @dylanpulver in https://github.com/vektra/mockery/pull/1178 - v3: add cpuprofile option by @ChrisJr404 in https://github.com/vektra/mockery/pull/1179
- feat: support embedded types in matryer mocks by @eliotee in https://github.com/vektra/mockery/pull/1184
- fix: mark testify mock constructors and cleanup as helpers by @eliotee in https://github.com/vektra/mockery/pull/1183
New Contributors
- @dylanpulver made their first contribution in https://github.com/vektra/mockery/pull/1178
- @ChrisJr404 made their first contribution in https://github.com/vektra/mockery/pull/1179
- @eliotee made their first contribution in https://github.com/vektra/mockery/pull/1184
Full Changelog: https://github.com/vektra/mockery/compare/v3.7.4...v3.8.0
v3.7.4
What's Changed
- fix: bump golang.org/x/tools to v0.49.0 for Go 1.27 support by @ergousha in https://github.com/vektra/mockery/pull/1172
- fix(ci): Upgrade for Go 1.27 by @LandonTClipp in https://github.com/vektra/mockery/pull/1174
New Contributors
- @ergousha made their first contribution in https://github.com/vektra/mockery/pull/1172
Full Changelog: https://github.com/vektra/mockery/compare/v3.7.3...v3.7.4
v3.7.3
What's Changed
- chore(tools): Update dependencies for licensing by @LandonTClipp in https://github.com/vektra/mockery/pull/1169
- v3: avoid in-package import collisions with package-scope declarations by @dgollahon-plaid in https://github.com/vektra/mockery/pull/1170
New Contributors
- @dgollahon-plaid made their first contribution in https://github.com/vektra/mockery/pull/1170
Full Changelog: https://github.com/vektra/mockery/compare/v3.7.2...v3.7.3
v3.7.2
What's Changed
- faq: highlight that package path errors can be due to case mismatch by @ikonst in https://github.com/vektra/mockery/pull/1164
- fix: correct typos in comments and docs by @maxtaran2010 in https://github.com/vektra/mockery/pull/1166
- Match interface{} as well as any by @skitt in https://github.com/vektra/mockery/pull/1167
New Contributors
- @ikonst made their first contribution in https://github.com/vektra/mockery/pull/1164
- @maxtaran2010 made their first contribution in https://github.com/vektra/mockery/pull/1166
Full Changelog: https://github.com/vektra/mockery/compare/v3.7.1...v3.7.2
v3.7.1
What's Changed
- (feat:template-data) Update documentation of InterfaceFile data by @ymohl-cl in https://github.com/vektra/mockery/pull/1149
- fix(cmd): fix file descriptor leak from defer in loop by @SVilgelm in https://github.com/vektra/mockery/pull/1154
- fix: replace 'interface{}' (old syntax) with 'any', especially for Te… by @aristorinjuang in https://github.com/vektra/mockery/pull/1159
- #1151: Fix error with InterfaceDirRelative for external paths by @takanuva15 in https://github.com/vektra/mockery/pull/1157
New Contributors
- @ymohl-cl made their first contribution in https://github.com/vektra/mockery/pull/1149
- @aristorinjuang made their first contribution in https://github.com/vektra/mockery/pull/1159
- @takanuva15 made their first contribution in https://github.com/vektra/mockery/pull/1157
Full Changelog: https://github.com/vektra/mockery/compare/v3.7.0...v3.7.1
v3.7.0
What's Changed
- Update example by @DenisPalnitsky in https://github.com/vektra/mockery/pull/1144
- Refactor name suggestion logic in method_scope.go by @LandonTClipp in https://github.com/vektra/mockery/pull/1148
- feat: goimports configuration options by @rfwatson in https://github.com/vektra/mockery/pull/1138
New Contributors
- @DenisPalnitsky made their first contribution in https://github.com/vektra/mockery/pull/1144
- @rfwatson made their first contribution in https://github.com/vektra/mockery/pull/1138
Full Changelog: https://github.com/vektra/mockery/compare/v3.6.4...v3.7.0
v3.6.4
What's Changed
- Basic documentation updates by @LandonTClipp in https://github.com/vektra/mockery/pull/1137
- v3: Support Go 1.26 by @LandonTClipp in https://github.com/vektra/mockery/pull/1142
Full Changelog: https://github.com/vektra/mockery/compare/v3.6.3...v3.6.4