Skip to content

Cannot compile client using Go modules #12009

Closed
@nnathan

Description

@nnathan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions