-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support go modules #94
Conversation
Co-Authored-By: Zac Bergquist <zbergquist@pivotal.io>
Looking forward to this! Just tried the branch out on Concourse, and noticed that the templates should be using |
fyi: had to locally change it to use text/template rather than html/template. see maxbrunsfeld/counterfeiter#94 (comment) for more info.
Nice catch on the html/template error @vito, thanks! I think it may have happened as I extracted the templates into their own files. Have quite a bit more progress to push up tomorrow. |
- they are problematic given the future direction of modules - they are packages that are locally vendored - we could add this back if we vendored a real package hosted somewhere on the internets, and have associated module definitions
Awesome work on this @joefitzgerald and @zmb3! |
Thanks so much for this PR. It provided an escape route when moving some code to a go modules repo and found that mockery was broken. |
This PR is intended to support go modules and set the stage for future changes (namely, to permit a variety of different fake types to be generated).
In effect, it's a total rewrite.
go/ast
totext/template
to generate the output fromcounterfeiter
. This means that in the future, people will be able to write their own templates and supply them tocounterfeiter
.go/parser
togo/packages
to load types.go/packages
is module aware.go 1.11
is out, and the go team supportgo 1.10
andgo 1.11
. This means thatcounterfeiter
is only tested to work withgo 1.10
orgo 1.11
at the time of this PR (although we expect to support future versions.counterfeiter
is now a go moduleWe would very much appreciate it if you can try out this branch and validate that your tests continue to function after using it.
Outstanding items:
go 1.11
module modeFixes #90