github.com/oschwald/maxminddb-golang 安装报错
2017-01-10 17:34 DillGao 阅读(1373) 评论(0) 编辑 收藏 举报安装
maxminddb-golang错误:
dill@ubuntu-vm:~/workspace/go/src/github.com$ go get github.com/oschwald/maxminddb-golang
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)
解决办法:
1. 添加golang.org/x/sys/unix:
dill@ubuntu-vm:~/workspace/go/src$ go get github.com/golang/sys
又报错 :can't load package: package github.com/golang/sys: \
no buildable Go source files in /home/dill/workspace/go/src/github.com/golang/sys
解决办法:
- git clone https://github.com/golang/sys.git
- mkdir -p golang.org/x/sys/unix ($GOPATH/src目录下)
- cp -r unix/ golang.org/x/sys/($GOPATH/src目录下)
- git clone https://github.com/golang/sys.git
2. 重新go get github.com/oschwald/maxminddb-golang 竟然好了,不知道原理,先记下吧!:+)