go-micro的环境配置相当坑,刚开始在golang1.15下运行的,后面配服务发现,升级到golang1.17, 千万不要用高版本,除非你非常熟悉go install, 因为主流教程都是go get的方式。
主要参考了 https://blog.csdn.net/June_King/article/details/122291473
没有大的问题,小问题有, 解决如下,consul 和 etcd 包注册的引用,要加别名,否则会系统会识别为v3
"github.com/asim/go-micro/plugins/registry/consul/v3" 改为 consul "github.com/asim/go-micro/plugins/registry/consul/v3" "github.com/asim/go-micro/plugins/registry/etcd/v3" 改为 etcd "github.com/asim/go-micro/plugins/registry/etcd/v3"