go安装echo框架

在执行 go get -u github.com/labstack/echo的时候报错如下:

wang@wang:~$ go get github.com/labstack/echo
package golang.org/x/sys/unix: unrecognized import path "golang.org/x/sys/unix" (https fetch: Get https://golang.org/x/sys/unix?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
package golang.org/x/crypto/acme: unrecognized import path "golang.org/x/crypto/acme" (https fetch: Get https://golang.org/x/crypto/acme?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
package golang.org/x/crypto/acme/autocert: unrecognized import path "golang.org/x/crypto/acme/autocert" (https fetch: Get https://golang.org/x/crypto/acme/autocert?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
wang@wang:~$ go get -u github.com/labstack/echo
package golang.org/x/net/idna: unrecognized import path "golang.org/x/net/idna" (https fetch: Get https://golang.org/x/net/idna?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

解决办法:
在$GOPATH/src下创建目录golang.org/x
在x目录下:
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/crypto.git
git clone https://github.com/golang/net.git
git clone https://github.com/golang/text.git

可以抓住规律,缺什么直接下载到对应目录,直到:

wang@wang:~/go/src/golang.org/x$ ls
crypto  net  sys  text

然后再执行:

wang@wang:~$ go get -u github.com/labstack/echo

便可成功。

你可能感兴趣的:(golang)