因grpc版本问题导致的报错
/opt/gocode/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
/opt/gocode/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
# github.com/coreos/etcd/clientv3/balancer/picker
/opt/gocode/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
/opt/gocode/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
解决办法修改依赖版本:
#修改依赖
go mod edit -require=google.golang.org/grpc@v1.26.0
#下载新版本
go get -u -x google.golang.org/grpc@v1.26.0
因go-system导致的问题
/opt/gocode/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/pkg/logutil/zap_journal.go:29:2: no matching versions for query "latest"
在GOPATH/src下执行
git clone https://github.com/coreos/go-systemd.git
在go mod里加入
replace github.com/coreos/go-systemd =>${自己的PATH路径}/github.com/go-systemd
有疑问加站长微信联系(非本文作者)