处理etcd源码包编译异常

1、下载etcd包,执行go build报异常:

client\v2\example_keys_test.go:1:1: expected 'package', found '.'
client\v3\example_auth_test.go:1:1: expected 'package', found '.'
client\v3\concurrency\example_election_test.go:1:1: expected 'package', found '.'

2、尝试解决方案:

我照网上的解决方案去处理,处理完之后报另外一个错误:

replace google.golang.org/grpc => google.golang.org/grpc v1.26.0
//在主目录下执行go.mod的replace下添加最后一行:
replace (
    go.etcd.io/etcd/api/v3 => ./api
    go.etcd.io/etcd/client/pkg/v3 => ./client/pkg
    go.etcd.io/etcd/client/v2 => ./client/v2
    go.etcd.io/etcd/client/v3 => ./client/v3
    go.etcd.io/etcd/etcdctl/v3 => ./etcdctl
    go.etcd.io/etcd/etcdutl/v3 => ./etcdutl
    go.etcd.io/etcd/pkg/v3 => ./pkg
    go.etcd.io/etcd/raft/v3 => ./raft
    go.etcd.io/etcd/server/v3 => ./server
    go.etcd.i

你可能感兴趣的:(go语言学习笔记,etcd,python,前端)