package's type cannot be used as the vendored package's type

The solution here seems to be that the library I'm trying to use needs to be reworked to prevent this kind of thing from happening.

The two possible ways to change the library seem to be

1) not vendor at all - this works if the dependency does not need to be a specific version.

2) vendored, but do not expose the vendored library to the public. Create some wrapper functions in the library so that people can create the types indirectly.

See this discussion about vendoring on reddit for more ideas/reasons why.


I had the same issue. As a work around, I deleted the associated package's vendor folder and moved their content to my $GOPATH folder.

Source of answer: https://github.com/prometheus/prometheus/issues/1720


Just had a similar issue. Putting both libraries in /vendor resolved. Using govendor get xxxx