Back to Night

go mod下出现looping trying to add package

content/discuss/2019-10-13-go-module-looping-package.md

latest859 B
Original Source

来源:『Go 夜读』微信群

时间:2019-10-13


问题

忽然之间出现looping trying to add package

意思就是循环引用某个类库,提示如下:

text

go: github.com/sirupsen/logrus imports
	golang.org/x/sys/unix: looping trying to add package

解决方法

删除go mod下的缓存,重新引用。

shell

sudo rm -fr "$(go env GOPATH)/pkg/mod"

参考

text

sudo rm -fr "$(go env GOPATH)/pkg/mod”
go get github.com/rancher/[email protected]
After going through a screenful of dependencies, the program aborts with following error.
....
....
go: downloading github.com/rancher/k3s v1.14.1-k3s.1
go: finding github.com/rancher/k3s v0.3.0
go: downloading github.com/rancher/k3s v0.3.0
go: import "github.com/rancher/k3s": looping trying to add package