matryer / moq

Interface mocking tool for go generate
http://bit.ly/meetmoq
MIT License
1.96k stars 126 forks source link

Add feature to generate mocks in directory #193

Open horpto opened 1 year ago

horpto commented 1 year ago

Hello, we use moq to generate mocks in the different directory in 1 mock to 1 file. So our genmock.go has a pile lines like this:

//go:generate moq -out "mocks/fee.go" -fmt goimports -skip-ensure . IFeeInterface
//go:generate moq -out "mocks/foo.go" -fmt goimports -skip-ensure . IFooInterface
//go:generate moq -out "mocks/goo.go" -fmt goimports -skip-ensure . IGooInterface

I'd like to add a feature to just specify directory and list of interfaces in one package. This also should be more quickly to generate mocks.

Also I fix version indication in release as gorelease will specify main.version, not main.Version

horpto commented 1 year ago

Hi @breml! Ok, I created a new pr with only small changes.