Open
Description
I've found that I prefer to use a package called "fake" for my fakes, and that I prefer to remove "Fake" from the type name. This looks like the following currently:
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//counterfeiter:generate -o fake -fake-name MyRepository . MyRepository
//counterfeiter:generate -o fake -fake-name MyPresenter . MyPresenter
This allows me to refer to the fake like this:
myRepository := new(fake.MyRepository)
Unfortunately, I have to repeat those -o
and -fake-name
arguments in every generate call. It would be nice to be able to do something like the following:
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate -o fake -fake-name-template "{{.TargetName}}"
//counterfeiter:generate . MyRepository
//counterfeiter:generate . MyPresenter
I'm happy to work on a PR to add this behavior, but I want to make sure you'd be open to the idea first. I'd also love to hear other ideas to accomplish the same goal of removing repetition and risk of inconsistency.
Thanks!
Metadata
Assignees
Labels
No labels
Activity