Issues - GitHub

Skip to content Dismiss alert {{ message }} / etcd Public
  • Notifications You must be signed in to change notification settings
  • Fork 10.3k
  • Star 51.5k
  • Code
  • Issues 116
  • Pull requests 85
  • Discussions
  • Actions
  • Security 14
  • Insights
Additional navigation options vendor/github.com/coreos/etcd/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption #12181New issueNew issueClosedClosedvendor/github.com/coreos/etcd/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption#12181@frodriguez-sr

Description

@frodriguez-srfrodriguez-sropened on Jul 29, 2020

There's an issue when try to vendoring the client

package main import ( "context" "flag" "fmt" "log" "time" "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/clientv3/concurrency" ) func main() { var name = flag.String("name", "", "give a name") flag.Parse() // Create a etcd client cli, err := clientv3.New(clientv3.Config{Endpoints: []string{"localhost:2379"}}) if err != nil { log.Fatal(err) } defer cli.Close() // create a sessions to aqcuire a lock s, _ := concurrency.NewSession(cli) defer s.Close() l := concurrency.NewMutex(s, "/distributed-lock/") ctx := context.Background() // acquire lock (or wait to have it) if err := l.Lock(ctx); err != nil { log.Fatal("cannot get lock") } fmt.Println("acquired lock for ", *name) fmt.Println("Do some work in", *name) time.Sleep(5 * time.Second) if err := l.Unlock(ctx); err != nil { log.Fatal(err) } fmt.Println("released lock for ", *name) }

Works when I run go run main.go -name first

But at the time to vendoring it has the same issue go mod init && go mod tidy and then

I got

go: src.srconnect.io/frodriguez/etcd_poc imports go.etcd.io/etcd/clientv3 tested by go.etcd.io/etcd/clientv3.test imports github.com/coreos/etcd/auth imports github.com/coreos/etcd/mvcc/backend imports github.com/coreos/bbolt: github.com/coreos/[email protected]: parsing go.mod: module declares its path as: go.etcd.io/bbolt but was required as: github.com/coreos/bbolt

If I run go mod vendor and then go run -mod=vendor main.go -name first

I get

# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint vendor/github.com/coreos/etcd/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption vendor/github.com/coreos/etcd/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption # github.com/coreos/etcd/clientv3/balancer/picker vendor/github.com/coreos/etcd/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions vendor/github.com/coreos/etcd/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions

Looks like some dependencies are broken or needs to be updated

Metadata

Metadata

Assignees

No one assigned

Labels

No labelsNo labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You can’t perform that action at this time.

Từ khóa » C-114/78