1. 问题现象
../github.com/coreos/etcd/client/json.go:18:2:
cannot find package "github.com/json-iterator/go" in any of:
/usr/local/go/src/github.com/json-iterator/go (from $GOROOT)
/home/wohu/GoCode/src/github.com/json-iterator/go (from $GOPATH)
../github.com/coreos/etcd/client/json.go:19:2:
cannot find package "github.com/modern-go/reflect2" in any of:
/usr/local/go/src/github.com/modern-go/reflect2 (from $GOROOT)
/home/wohu/GoCode/src/github.com/modern-go/reflect2 (from $GOPATH)
2. 解决方案
go get -v github.com/json-iterator/go
示例:
wohu@wohu:~/GoCode/src$ go get -v github.com/json-iterator/go
github.com/json-iterator/go (download)
github.com/modern-go/concurrent (download)
github.com/modern-go/reflect2 (download)
github.com/modern-go/concurrent
github.com/modern-go/reflect2
github.com/json-iterator/go
wohu@wohu:~/GoCode/src$
版权声明:本文为wohu1104原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。