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
I expected to have access to the google gRPC library from the local vendor folder.
What did you see instead?
The gRPC library from another project in the same $GOPATH was being used instead, causing a 'incorrect type' error.
./main.go:44: cannot use conn (type *"bitbucket.org/bandzest/bandzest-service-artists/api/vendor/google.golang.org/grpc".Clien
tConn) as type *"bitbucket.org/bandzest/bandzest-service-auth/api/vendor/google.golang.org/grpc".ClientConn in argument to pro
to.NewAuthClient
The text was updated successfully, but these errors were encountered:
josharian
changed the title
Go project using library from another vendor folder under the same $GOPATH causing type error
cmd/go: Go project using library from another vendor folder under the same $GOPATH causing type error
Nov 7, 2016
If project A imports project B, project B needs to be added to project A's vendor folder by a tool like govendor so that it can flatten out the dependency graph so there is only one version of each dependency for project A.
This sounds like it is WAI. Go treats each vendored package as a separate package. If you want to use types from one vendored library across two packages, those packages need to share a single library in a single vendor directory.
If you don't think that's what is happening here, please provide a complete test case (with two packages) and we can try to reproduce.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Go 1.7.3
What operating system and processor architecture are you using (
go env
)?What did you do?
Ran...
In project A, then...
In project B.
What did you expect to see?
I expected to have access to the google gRPC library from the local vendor folder.
What did you see instead?
The gRPC library from another project in the same $GOPATH was being used instead, causing a 'incorrect type' error.
The text was updated successfully, but these errors were encountered: