导入软件包时收到此错误,请问如何解决此问题?

时间:2019-05-07 14:22:48

标签: go import package

当我运行以下命令时:

go get github.com/docker/go-plugins-helpers/volume

它打印:

 github.com/docker/go-connections/sockets

../github.com/docker/go-connections/sockets/sockets.go:35:26: dialer.DialContext undefined (type proxy.Dialer has no field or method DialContext)

../github.com/docker/go-connections/sockets/sockets_unix.go:24:28: undefined: context

2 个答案:

答案 0 :(得分:0)

您正在使用proxy.Dialer,而您似乎想要net.Dialer,因为该用户有一个DialContext

答案 1 :(得分:0)

对于那些不熟悉go的人(例如我),一个非常临时的解决方法(直到有https://github.com/docker/go-connections/issues/60的修复程序)将是:

cd ~/go/src/github.com/docker/go-connections
git checkout 9885905e989f4d8cc9f42d3549c5be9c27e4460d
go get github.com/docker/go-connections/sockets
cd -

欢呼