-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the clientv3 readme is out of date for go modules #11772
Comments
Same problem here with 3.3.20.
go.mod file
Also results in this upon compilation
|
Yeah got that one too, I think after adding |
The last bunch of errors happens because of #11721 |
i add |
Thank you liangjfblue both of my errors are now gone and my full go.mod file looks like this:
|
I feel like we shouldn't have to resort to such hacks to just get a working client. Having no experience with etcd, getting things working was extremely frustrating, almost to the point of completely dropping etcd from the project. |
1.codepackage main
import (
"context"
"go.etcd.io/etcd/clientv3"
"time"
)
func main() {
cli, err := clientv3.New(clientv3.Config{
Endpoints: []string{"192.168.20.204:2379", "192.168.20.205:2379", "192.168.20.206:2379"},
DialTimeout: 5 * time.Second,
})
if err != nil {
// handle error!
}
defer cli.Close()
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
_, err = cli.Put(ctx, "sample_key", "sample_value")
cancel()
if err != nil {
// handle error!
}
} 2.step
3.command
|
import (
"github.com/coreos/etcd/clientv3"
) i use go mod init |
老铁牛逼! |
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. |
I'm getting a project started which uses etcd and the
clientv3/concurrency
package. The project uses go modules.The README says to just run
go get go.etcd.io/etcd/clientv3
but with go mod this is what it produces:it defaults to an old version from 2017. A simple program like this compiles:
but if I try to use the
concurrency
package it fails:with this error:
at this point I tried to explicitily get the v3.4.7 tag but it fails:
I also tried to get the v3.3.20 tag but it fails too, first with this:
then if I try to update
github.com/coreos/etcd/clientv3
to v3.3.20 I get this:In the end the only thing that worked for me is to just
go get go.etcd.io/etcd/clientv3@master
, this is not a good solution however.Is there something I'm missing to be able to use a tagged release of clientv3 with go modules ?
The text was updated successfully, but these errors were encountered: