cannot find package golang.org/x/sys/unix

开发好的go项目,在windows上运行的好好的,等拿到linux上编译时,报错,找不到核心包,用共go get命令也获取不到,查资料说是被墙了,幸好github上又对应的包下载,https://github.com/golang?page=1
下载后,成功解决。

t@iz2ze4ry74x8bcjlbuvzawz ~]# go  run service.go 
go/src/github.com/shirou/gopsutil/disk/disk_linux.go:17:2: cannot find package "golang.org/x/sys/unix" in any of:
        /usr/lib/golang/src/golang.org/x/sys/unix (from $GOROOT)
        /root/go/src/golang.org/x/sys/unix (from $GOPATH)
[root@iz2ze4ry74x8bcjlbuvzawz ~]# cd /usr/lib/golang/src/golang.org/x
-bash: cd: /usr/lib/golang/src/golang.org/x: No such file or directory

mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/sys.git

你可能感兴趣的:(工具使用)