GO库安装报错解决:unrecognized import path "golang.org/x/net" (https fetch: dial tcp i/o timeout

今天想用goquery时,报错说golang.org\x\net\html没安装。

..\github.com\andybalholm\cascadia\selector.go:9:2: cannot find package "golang.org/x/net/html" in any of:
	C:\Go\src\golang.org\x\net\html (from $GOROOT)
	C:\Users\peter\go\src\golang.org\x\net\html (from $GOPATH)

但是直接安装会报错:

package golang.org/x/net/html/...: unrecognized import path "golang.org/x/net/html" (https fetch: Get https://golang.org/x/net/html?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
$ go get -u golang.org/x/net
package golang.org/x/net: unrecognized import path "golang.org/x/net" (https fetch: Get https://golang.org/x/net?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

解决方法是从GitHub上clone下来:

git clone https://github.com/golang/net.git  $GOPATH/src/golang.org/x/net

常见的库:

git clone https://github.com/golang/net.git  $GOPATH/src/golang.org/x/net
git clone https://github.com/golang/tools.git  $GOPATH/src/golang.org/x/tools
git clone https://github.com/golang/crypto.git  $GOPATH/src/golang.org/x/crypto
git clone https://github.com/golang/sys.git  $GOPATH/src/golang.org/x/sys

你可能感兴趣的:(go,行走的问题解决机)