Module found but does not contain package


I have a dependency issue with Go and was trying to understand the root cause, hopefully someone can shed some light.

I’m using the Prometheus go client ( ) as a dependency in my Go project. This has a transitive dependency called xxhash, which is discoverable by module aware versions of Go through the virtual path of It looks like this utility was recently updated to use go modules and this is indicated by its v2 suffix.

I’m running go 1.17.7 in module mode and using the default GoPath. When I try to run go mod tidy it returns the following error. module found (v2.1.2), but does not contain package

I’m running in module mode and this is a transitive dependency so I expect that go will look in $GOPATH\pkg\mod\cache\download\\cespare\xxhash\v2\@v to find that version. I do see that version cached in that precise folder. I also notice however that go creates a directory for the same dependency at $GOPATH\pkg\mod\\cespare\xxhash\v2@v2.1.2 but the source has not been downloaded.

I’ve read other threads where this was resolved by upgrading to a newer version of Go which was module aware , or alternatively upgrading the version of the Prometheus client however in this case I’m on the latest for each.


The original GOPATH configuration was using a mirror proxy, in the form of Artifactory, for dependency resolution. Checksum collisions prevented pulling in all dependencies. I reverted to to resolve the issue

Answered By – cdugga

Answer Checked By – Katrina (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.