You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
We would like to "vendorize" mockgen in our project, in order to freeze the version we are using and prevent unexpected breakages. We already do this with gomock for the same reason. We use govendor for this.
We vendorize gomock with govendor fetch github.com/golang/mock/[email protected]. Then, we can install mockgen from the vendor/ directory using govendor install +vendor. However, when we try to run mockgen, we get the following output:
prog.go:11:2: cannot find package "github.com/golang/mock/mockgen/model" in any of:
/usr/local/Cellar/go/1.8.3/libexec/src/github.com/golang/mock/mockgen/model (from $GOROOT)
/<omitted>/go/src/github.com/golang/mock/mockgen/model (from $GOPATH)
This is obviously because the package github.com/golang/mock/mockgen/model is not at the mentioned locations, but under our vendor/ directory. One way to fix this is to run go get -u github.com/golang/mock/mockgen, which places the model package under $GOPATH. Another way is to run govendor get -u github.com/golang/mock/[email protected], which is what we currently do. The advantage to "vendorizing" it as described above is that it centralizes the version management with the rest of our dependencies.
Why is there a runtime dependency on this model package? Shouldn't it be compiled into the mockgen binary? Is there any way to install mockgen from the vendor directory?
codygibb, renatomariscal, luciferous, LasTshaMAN, kishaningithub and 1 more