I'm trying to write a program using the clientv3 client.
package main
import (
"fmt"
"time"
"github.com/coreos/etcd/clientv3"
)
func main() {
baseconfig := clientv3.Config{
Endpoints: []string{"http://127.0.0.1:2379"},
DialTimeout: 2 * time.Second,
DialKeepAliveTime: 2 * time.Second,
DialKeepAliveTimeout: 6 * time.Second,
}
client, err := clientv3.New(baseconfig)
if err != nil {
fmt.Printf("error creating client: %v", err)
}
_ = client
}
I'm also using Go modules. When I try to build the example program:
$ go build
go: finding module for package github.com/coreos/etcd/clientv3
go: downloading github.com/coreos/etcd v0.5.0-alpha.5
go: found github.com/coreos/etcd/clientv3 in github.com/coreos/etcd v3.3.22+incompatible
go: finding module for package google.golang.org/grpc/keepalive
go: finding module for package github.com/google/uuid
go: finding module for package github.com/golang/protobuf/proto
go: finding module for package google.golang.org/grpc/credentials
go: finding module for package github.com/coreos/pkg/capnslog
go: finding module for package google.golang.org/grpc
go: finding module for package google.golang.org/grpc/grpclog
go: finding module for package go.uber.org/zap
go: finding module for package google.golang.org/grpc/metadata
go: finding module for package google.golang.org/grpc/resolver
go: finding module for package go.uber.org/zap/zapcore
go: finding module for package github.com/gogo/protobuf/gogoproto
go: finding module for package github.com/coreos/go-semver/semver
go: finding module for package google.golang.org/genproto/googleapis/api/annotations
go: finding module for package github.com/coreos/go-systemd/journal
go: finding module for package google.golang.org/grpc/balancer
go: finding module for package google.golang.org/grpc/resolver/dns
go: downloading google.golang.org/genproto v0.0.0-20200612171551-7676ae05be11
go: finding module for package google.golang.org/grpc/status
go: finding module for package google.golang.org/grpc/codes
go: finding module for package google.golang.org/grpc/resolver/passthrough
go: finding module for package google.golang.org/grpc/connectivity
go: found github.com/coreos/pkg/capnslog in github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
go: found github.com/google/uuid in github.com/google/uuid v1.1.1
go: found go.uber.org/zap in go.uber.org/zap v1.15.0
go: found google.golang.org/grpc in google.golang.org/grpc v1.29.1
go: found github.com/gogo/protobuf/gogoproto in github.com/gogo/protobuf v1.3.1
go: found github.com/golang/protobuf/proto in github.com/golang/protobuf v1.4.2
go: found google.golang.org/genproto/googleapis/api/annotations in google.golang.org/genproto v0.0.0-20200612171551-7676ae05be11
go: found github.com/coreos/go-systemd/journal in github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
go: found github.com/coreos/go-semver/semver in github.com/coreos/go-semver v0.3.0
# github.com/coreos/etcd/clientv3/balancer/picker
../../go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
../../go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
../../go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
../../go/pkg/mod/github.com/coreos/[email protected]+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
Maybe I shouldn't be building off the latest tree, but I don't know how to dial back to a stable version of etcd using go modules either. Any help would be appreciated.
I am having the same issue as well, tried manually cloning 3.4 version ran into same error.
Is this project dead?
It's so hard to use, even write a simple hello world example.
Why?
@tennessine It seems to be impossible to contact with anyone that works on etcd.
google.golang.org/grpc v1.26.0
@gyuho go mod will get lastest version package default. GRPC-GO's lastest version was 1.29.1 at https://pkg.go.dev/google.golang.org/grpc?tab=doc . Do you have some ideas about this bug?
add a go.mod file to git repository?
ref. https://github.com/etcd-io/etcd/issues/11931
/cc @gyuho @mitake @spzala
@nnathan or use this shell
$ go mod edit -replace=google.golang.org/grpc=google.golang.org/[email protected]
$ make
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
Most helpful comment
Is this project dead?
It's so hard to use, even write a simple hello world example.
Why?