Issue

Install go-micro(&micro)
Run following command

  1. go get github.com/micro/go-micro

Detail

error info

weny@weny-server:~/Projects/Golang$ go install github.com/micro/go-micro
# github.com/micro/go-micro/transport/quic
src/github.com/micro/go-micro/transport/quic/quic.go:121:3: unknown field 'IdleTimeout' in struct literal of type quic.Config
# github.com/coreos/etcd/clientv3
src/github.com/coreos/etcd/clientv3/auth.go:121:72: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.AuthEnable
src/github.com/coreos/etcd/clientv3/auth.go:126:74: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.AuthDisable
src/github.com/coreos/etcd/clientv3/auth.go:131:152: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserAdd
src/github.com/coreos/etcd/clientv3/auth.go:136:144: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserAdd
src/github.com/coreos/etcd/clientv3/auth.go:141:86: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserDelete
src/github.com/coreos/etcd/clientv3/auth.go:146:122: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserChangePassword
src/github.com/coreos/etcd/clientv3/auth.go:151:104: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserGrantRole
src/github.com/coreos/etcd/clientv3/auth.go:156:80: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserGet
src/github.com/coreos/etcd/clientv3/auth.go:161:72: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserList
src/github.com/coreos/etcd/clientv3/auth.go:166:106: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserRevokeRole
src/github.com/coreos/etcd/clientv3/auth.go:166:106: too many errors

Cause

@khenaidoo With the move to go.etcd.io/etcd, there are some (unavoidable?) dependency resolution issues:

The identity crisis case:

github automatically creates redirects for project moves, so github.com/coreos/etcd now redirects to github.com/etcd-io/etcd, which means that if you depend on github.com/coreos/etcd on master, or the git hash of this PR or newer, you’re dependency manager (or go get) will pull code from github.com/coreos/etcd (following the redirect to github.com/etcd-io/etcd) and pull down etcd source that contains imports to go.etcd.io/etcd packages, but it will think the code is for the github.com/coreos/etcd and so it will believe that the github.com/etcd-io/etcd imports are to a different project. I believe the dependency manger (or go get) will then also pull in the go.etcd.io/etcd project since it saw import statements for it, which means you’ve got two copies of etcd in your dependencies with import statements between them, resulting in error messages like you’ve shown.

Possible fixes:

  • Depend on a released etcd version (git tags like v3.3.9) instead of master since all released versions reference coreos/etcd in imports and will work just fine.
  • If one needs to depend on master, explicitly update all import statements to go.etcd.io/etcd and verify there are no direct or transitive dependencies remain for github.com/coreos/etcd.

ref:https://github.com/etcd-io/etcd/pull/10044#issuecomment-417125341

Related issues:

*: rename import paths to “go.etcd.io/etcd”

  #10044<br />[https://github.com/etcd-io/etcd/pull/10044#issuecomment-417125341](https://github.com/etcd-io/etcd/pull/10044#issuecomment-417125341)<br />/etcd/clientv3 cannot use auth.callOpts (type 

  #870<br />[https://github.com/micro/go-micro/issues/870](https://github.com/micro/go-micro/issues/870)

Go vesrion

go version go1.13.5 linux/amd64

Go Env

root@571f03ab64ad:~# go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build666438605=/tmp/go-build -gno-record-gcc-switches"

Recent Changes in Go 1.13

The GO111MODULE environment variable continues to default to auto, but the auto setting now activates the module-aware mode of the go command whenever the current working directory contains, or is below a directory containing, a go.mod file — even if the current directory is within GOPATH/src. This change simplifies the migration of existing code within GOPATH/src and the ongoing maintenance of module-aware packages alongside non-module-aware importers.

ref:https://tip.golang.org/doc/go1.13#modules

GO111MODULE=auto enables module-mode if any go.mod is found, even inside GOPATH. (Prior to Go 1.13, GO111MODULE=auto would never enable module-mode inside GOPATH).

ref:https://github.com/golang/go/wiki/Modules

Solution

set the GO111MODULE to on

Point( in this case )

By default (GO111MODULE=auto),enabling module-mode depends on if any go.mod is found
GO111MODULE does not default to on

Fix

set the GO111MODULE environment variable
export GO111MODULE=on

if Need

run
go clean -modcache