-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate mode accepts -o, -fake-name-template & -q
When the -generate flag is given with a -o flag, that flag will be the default value for each invocation. If the invocation specifies it's own -o, then that value will be used. Similar logic applies for the -header flag (which was true before this commit) and for the -q flag. Also, there is now a -fake-name-template flag when -generate is provided. When an invocation does not specify a -fake-name, the value in -fake-name-template will be evaluated as a text/template string and then run against an object with a `TargetName` field. The result will be the -fake-name for the invocation. For example, the following comments will result in a fake named `TheMaskedSinger` in the `fakes` package: //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate -o fakes -fake-name-template "TheMasked{{.TargetName}}" //counterfeiter:generate . Singer [Issue #191] Authored-by: Matt Royal <[email protected]>
- Loading branch information
1 parent
c61e04c
commit 7718e31
Showing
9 changed files
with
1,060 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.