v2.0.2
Changes
This release fixes the package name generation by using a smarter algorithm. Specifically directories with dashes in the directory base names have bitten people more than once in the past (including me).
Here's how the new algorithm works: It first checks if there are already _test.go
files in the directory where the mock file is created and uses the test package name if possible. If no test files are present it looks for .go
files and uses their package name + _test
. If no .go
files exist at all in the directory, it uses the directory base name and converts potential -
s to _
s to make Go happy.
This algorithm is a bit slower than code used to be, but also more robust. If people see a problem with that, please open an issue. A workaround is to simply provide the package name via --package
. That will be very fast.