获取不到所有依赖项

huangapple go评论87阅读模式
英文:

Go get not fetching all dependencies

问题

我正在使用Windows 8.1 64位操作系统上的go 1.5.1版本。我的环境中没有设置GO15VENDOREXPERIMENT。我已经安装了最新版本的git和bazaar。

我正在尝试获取gomniauth包:

go get github.com/stretchr/gomniauth

尽管这个过程没有出现任何错误,但是很多依赖项没有被拉取下来。

例如,当编译依赖于gomniauth的应用程序时,我会遇到以下错误:

..\github.com\stretchr\codecs\xml\simple_xml_codec.go:5:2: 找不到包"github.com/clbanning/x2j",它在以下任何位置都不存在:
	C:\Go\src\github.com\clbanning\x2j (来自$GOROOT)
	C:\work\src\github.com\clbanning\x2j (来自$GOPATH)
..\github.com\stretchr\codecs\msgpack\msgpack_codec.go:6:2: 找不到包"github.com/ugorji/go/codec",它在以下任何位置都不存在:
	C:\Go\src\github.com\ugorji\go\codec (来自$GOROOT)
	C:\work\src\github.com\ugorji\go\codec (来自$GOPATH)
..\github.com\stretchr\codecs\bson\bson_codec.go:5:2: 找不到包"labix.org/v2/mgo/bson",它在以下任何位置都不存在:
	C:\Go\src\labix.org\v2\mgo\bson (来自$GOROOT)
	C:\work\src\labix.org\v2\mgo\bson (来自$GOPATH)

它似乎只拉取了gomniauth的直接依赖项,但没有拉取依赖项的依赖项。我已经删除了GOPATH/srcGOPATH/pkg中的stretchr文件夹,但是在多次运行go get之后,它仍然没有拉取任何超过第二级的依赖项。

我非常确定我的网络没有问题。我可以使用浏览器或curl访问这些GitHub仓库。

英文:

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.

答案1

得分: 9

将目录更改为您的项目,然后尝试go get ./...。例如:

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

或者只需按照Amit Kumar Gupta的建议执行go get github.com/stretchr/gomniauth/...

英文:

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

答案2

得分: 0

在我的情况下,我缺少了bzr包

在使用dnf install bzr命令添加它并运行@RoninDev的建议后,它按预期工作:

cd $GOPATH/src/github.com/stretchr/gomniauth
go get ./...
英文:

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 ./...

huangapple
  • 本文由 发表于 2015年11月25日 12:04:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/33908307.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定