原文连接:https://javasgl.github.io/go-get-golang-x-packages/ 侵权联系删除!php
go在go get 一些 package时候的会因为众所周知的缘由而没法下载。好比在安装 bee的时候有可能会遇到没法下载 golang.org/x/sys/unix 的问题。java
unrecognized import path "golang.org/x/sys/unix"
解决方案:手动从github下载相应的packagegit
git clone --depth=1 https://github.com/golang/xxx.git git clone --depth=1 https://github.com/golang/xxx.git
注:xxx 为对应的须要的库github
举例:这里要下载golang.org/x/sys/unix, 对应到github地址为:github.com/golang/sys.git 。golang
下载完成后,软链或者复制 到 $GOPATH/src/golang.org/x/ 下便可。ui
如: $ mv sys ~/go/src/golang.org/x/spa
golang.org/
└── x
├── net
├── sys
└── tools
4 directories
更为简便的方法:unix
mkdir -p $GOPATH/src/golang.org/x/ cd !$ git clone https://github.com/golang/net.git git clone https://github.com/golang/sys.git git clone https://github.com/golang/tools.git