【golang】使用rpcx不指定tags报错 undefined: serverplugin.ConsulRegisterPlugin

为了避免引入不必要的库, rpcx采用了 Go 条件编译 的特性, 你可以只引入必要的特性。 比如你只使用 etcd 作为注册中心的时候, 你不希望引入 consul、zookeeper相关的库,你需要在 Go BuildTags中指定 etcd。

如果不指定 tags,可能会出现下面的错误。

.server.go:37:8: undefined: serverplugin.ConsulRegisterPlugin

https://github.com/smallnest/rpcx/wiki/BuildTags

 go get -u -v -tags "reuseport quic kcp zookeeper etcd consul ping utp" github.com/smallnest/rpcx/... 
posted @ 2019-07-25 10:05  landv  阅读(537)  评论(0编辑  收藏  举报