欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

cannot find package “github.com/json-iterator/go“cannot find package “github.com/modern-go/reflect2“

发布时间:2023/11/28 65 豆豆
生活随笔 收集整理的这篇文章主要介绍了 cannot find package “github.com/json-iterator/go“cannot find package “github.com/modern-go/reflect2“ 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

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$ 

总结

以上是生活随笔为你收集整理的cannot find package “github.com/json-iterator/go“cannot find package “github.com/modern-go/reflect2“的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。