9

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.

F21
  • 32,163
  • 26
  • 99
  • 170
  • Are you sure these are dependencies of `gominiauth`? If yes: Why are you sure? – Volker Nov 25 '15 at 05:39
  • By looking at the sources of `gomniauth` and its dependencies. `gomniauth` depends on `stretchr/codecs` which depends on `clganning/x2j`, `ugorji/go/codec` and `labix.org/v2/mgo/bson`. – F21 Nov 25 '15 at 05:47

2 Answers2

9

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

RoninDev
  • 5,446
  • 3
  • 23
  • 37
  • 1
    Or just `go get github.com/stretchr/gomniauth/...` – Amit Kumar Gupta Nov 25 '15 at 06:15
  • `go get github.com/stretchr/gomniauth/...` Works for me. What does the `...` do? Doesn't appear in the docs for `go get`: https://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies Also, why the need for `...`? Wouldn't people installing things with `go get` want all the dependencies so that the packages work? – F21 Nov 25 '15 at 08:38
  • It's a wildcard. See http://stackoverflow.com/questions/28031603/what-do-three-dots-mean-in-go-command-line-invocations – RoninDev Nov 25 '15 at 08:54
  • That makes sense, but why would the default behavior not automatically expand all the import paths so that all the dependencies are installed? – F21 Nov 25 '15 at 09:24
  • @AmitKumarGupta when I run 'go get github.com/stretchr/gomniauth/...' I `get go: missing Bazaar command. See https://golang.org/s/gogetcmd package labix.org/v2/mgo/bson: exec: "bzr": executable file not found in %PATH%` I just installed Bazaar and set %PATH% and I am not sure what is going on? – M Y Sep 17 '16 at 03:24
  • @hellyale It seems to me that you should install Bazaar first – RoninDev Sep 19 '16 at 06:10
  • @RoninDev turns out I needed to restart my computer for the install to complete 'doh – M Y Sep 19 '16 at 16:46
0

In my case I was missing the bzr package.

After adding it using dnf install bzr and running @RoninDev suggestion it worked as expected:

cd $GOPATH/src/github.com/stretchr/gomniauth
go get ./...
michaelbn
  • 7,393
  • 3
  • 33
  • 46