Search code examples
gopackage-management

Go get not fetching all dependencies


I am using go 1.5.1 on Windows 8.1 64-bit. I do not have GO15VENDOREXPERIMENT set in my environment. I have the latest version of git and bazaar installed.

I am trying to get the gomniauth package:

go get github.com/stretchr/gomniauth

Even though the process completes without any error, a lot of dependencies aren't pulled in.

For example, when compiling my app (which depends on gomniauth), I get these errors:

..\github.com\stretchr\codecs\xml\simple_xml_codec.go:5:2: cannot find package "github.com/clbanning/x2j" in any of:
    C:\Go\src\github.com\clbanning\x2j (from $GOROOT)
    C:\work\src\github.com\clbanning\x2j (from $GOPATH)
..\github.com\stretchr\codecs\msgpack\msgpack_codec.go:6:2: cannot find package "github.com/ugorji/go/codec" in any of:
    C:\Go\src\github.com\ugorji\go\codec (from $GOROOT)
    C:\work\src\github.com\ugorji\go\codec (from $GOPATH)
..\github.com\stretchr\codecs\bson\bson_codec.go:5:2: cannot find package "labix.org/v2/mgo/bson" in any of:
    C:\Go\src\labix.org\v2\mgo\bson (from $GOROOT)
    C:\work\src\labix.org\v2\mgo\bson (from $GOPATH)

It seems to pull in the direct dependencies for gomniauth, but doesn't pull in the dependencies of the dependencies. I have gone and deleted the stretchr folder from my GOPATH/src as well as GOPATH/pkg, but after running go get many times, it is still not pulling in the any dependencies beyond the second level.

I am 100% confident there are no network issues on my end. I can access those github repos using my browser or curl.


Solution

  • Change directory to your project and then try go get ./...
    E.g.:

    cd C:\work\src\github.com\stretchr\gomniauth
    go get ./...
    

    Or just go get github.com/stretchr/gomniauth/... as Amit Kumar Gupta suggested