Closed codyoss closed 4 years ago
@codyoss what are the commands that you use to get mockgen? This is what I get:
nguyenfilip@nguyenfilip:~$ GO111MODULE=on go get github.com/golang/mock/mockgen@latest
go: finding github.com/golang/mock v1.4.0
go: downloading github.com/golang/mock v1.4.0
go: extracting github.com/golang/mock v1.4.0
nguyenfilip@nguyenfilip:~$ mockgen -version
v1.4.0
My go version:
nguyenfilip@nguyenfilip:~$ go version
go version go1.13.4 linux/amd64
Sorry, you are right that does work. The use case I ran into was for us publishing prebuilt binaries. Updated initial steps. Thoughts?
What are the steps that you use to prebuild binaries? I will check if we can build in a way that it includes the module info. As a sidenote: As I mentioned in the description of #362, the best way to support prebuilt binaries would be to combine the current approach with build flags (-ldflags
). Note that the build flags approach is useful only for prebuild binaries. It would not help at all when running go get
- which is what most of our users seem to be doing.
Good point on the ldflags. That would work fine. I will using goreleaser to make the binaries. That does allow for custom flags to be sent through. goreleaser release --skip-publish --skip-validate --rm-dist
is the command I used locally to do a dry run that builds the binaries. Note there is a small bug in the config right now I noticed when I was playing with it last night. If we could just update that to pass the proper flags though I think that is good enough.
@codyoss I will check the goroleaser. It would be nice if we mitigated a need for build flags
Actual behavior A clear and concise description of what the bug is.
When building locally unable to retrieve a version. This makes it hard should we want to publish pre-built binaries.
Expected behavior A clear and concise description of what you expected to happen.
mockgen -version
outputs version info.