go依赖包安装报错:unrecognized import path golang.org/x/crypto/ssh/terminal
使用 godep报错$godep restoregodep: [WARNING]: godep should only be used inside a valid go package directory andgodep: [WARNING]: may not function correctly. You are probably outside of your $GOPATH.godep:
·
使用 godep报错
$godep restore
godep: [WARNING]: godep should only be used inside a valid go package directory and
godep: [WARNING]: may not function correctly. You are probably outside of your $GOPATH.
godep: [WARNING]: Current Directory: /root/go/k8s-controller-custom-resource
godep: [WARNING]: $GOPATH: /root/go
godep: error downloading dep (golang.org/x/crypto/ssh/terminal): unrecognized import path "golang.org/x/crypto/ssh/terminal"
尝试使用golang提供的公共代理服务 GOPROXY
$export GOPROXY=https://goproxy.io
$export GO111MODULE=on
$cd /root/go/k8s-controller-custom-resource
$go mod init
warning: GOPATH set to GOROOT (/root/go/k8s-controller-custom-resource) has no effect
go: creating new go.mod: module k8s.io/sample-controller
go: copying requirements from Godeps/Godeps.json
....
$export GOPATH=/root/go
$go mod download
更多推荐
已为社区贡献2条内容
所有评论(0)