安装micro以及处理go-get出现的问题

42次阅读

共计 22709 个字符,预计需要花费 57 分钟才能阅读完成。

因为试了很多方法都没能成功的使用go get,最后试出了这一个方法。

  • 国内,请 架梯子,全局 ,下面以这个方法进行。当然如果你有足够的耐心,git clone 应该也是可以的,但我没有这个胆量,毕竟一个 go get 就已经拉下来 300+MB 的代码,具体有几个库我没数。
  • GOPROXY 改回来默认的:export GOPROXY=

在执行 go get 前,我已经把第三方库全清了,如果你没有清,请加参数-u

第一次执行go get

执行命令go get -v github.com/micro/micro

耐心等候 …(下面是我跑命令的结果)

[yangzhao@yangzhaodeMacBook-Pro:] ~/Dev/Gopath/src $go get -v github.com/micro/micro
github.com/micro/go-micro (download)
github.com/google/uuid (download)
github.com/micro/mdns (download)
github.com/miekg/dns (download)
get "golang.org/x/crypto/ed25519": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at //golang.org/x/crypto/ed25519?go-get=1
get "golang.org/x/crypto/ed25519": verifying non-authoritative meta tag
golang.org/x/crypto (download)
get "golang.org/x/net/ipv4": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at //golang.org/x/net/ipv4?go-get=1
get "golang.org/x/net/ipv4": verifying non-authoritative meta tag
golang.org/x/net (download)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
golang.org/x/sys (download)
get "golang.org/x/net/ipv6": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at //golang.org/x/net/ipv6?go-get=1
get "golang.org/x/net/ipv6": verifying non-authoritative meta tag
github.com/go-log/log (download)
get "golang.org/x/net/http2": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at //golang.org/x/net/http2?go-get=1
get "golang.org/x/net/http2": verifying non-authoritative meta tag
get "golang.org/x/text/secure/bidirule": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text/secure/bidirule?go-get=1
get "golang.org/x/text/secure/bidirule": verifying non-authoritative meta tag
golang.org/x/text (download)
get "golang.org/x/text/unicode/bidi": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text/unicode/bidi?go-get=1
get "golang.org/x/text/unicode/bidi": verifying non-authoritative meta tag
get "golang.org/x/text/unicode/norm": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text/unicode/norm?go-get=1
get "golang.org/x/text/unicode/norm": verifying non-authoritative meta tag
github.com/nats-io/nats.go (download)
github.com/nats-io/jwt (download)
github.com/nats-io/nkeys (download)
github.com/nats-io/nuid (download)
github.com/pkg/errors (download)
get "google.golang.org/grpc": found meta tag get.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at //google.golang.org/grpc?go-get=1
google.golang.org/grpc (download)
get "google.golang.org/grpc/credentials": found meta tag get.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at //google.golang.org/grpc/credentials?go-get=1
get "google.golang.org/grpc/credentials": verifying non-authoritative meta tag
get "google.golang.org/grpc/metadata": found meta tag get.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at //google.golang.org/grpc/metadata?go-get=1
get "google.golang.org/grpc/metadata": verifying non-authoritative meta tag
get "google.golang.org/grpc/encoding": found meta tag get.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at //google.golang.org/grpc/encoding?go-get=1
get "google.golang.org/grpc/encoding": verifying non-authoritative meta tag
get "google.golang.org/grpc/status": found meta tag get.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at //google.golang.org/grpc/status?go-get=1
get "google.golang.org/grpc/status": verifying non-authoritative meta tag
get "google.golang.org/genproto/googleapis/rpc/status": found meta tag get.metaImport{Prefix:"google.golang.org/genproto", VCS:"git", RepoRoot:"https://github.com/google/go-genproto"} at //google.golang.org/genproto/googleapis/rpc/status?go-get=1
get "google.golang.org/genproto/googleapis/rpc/status": verifying non-authoritative meta tag
google.golang.org/genproto (download)
github.com/json-iterator/go (download)
github.com/modern-go/concurrent (download)
github.com/modern-go/reflect2 (download)
github.com/coreos/etcd (download)
get "go.etcd.io/etcd/auth/authpb": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/auth/authpb?go-get=1
get "go.etcd.io/etcd/auth/authpb": verifying non-authoritative meta tag
go.etcd.io/etcd (download)
get "go.etcd.io/etcd/clientv3/balancer": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/clientv3/balancer?go-get=1
get "go.etcd.io/etcd/clientv3/balancer": verifying non-authoritative meta tag
get "go.etcd.io/etcd/clientv3/balancer/picker": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/clientv3/balancer/picker?go-get=1
get "go.etcd.io/etcd/clientv3/balancer/picker": verifying non-authoritative meta tag
get "go.etcd.io/etcd/clientv3/balancer/resolver/endpoint": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/clientv3/balancer/resolver/endpoint?go-get=1
get "go.etcd.io/etcd/clientv3/balancer/resolver/endpoint": verifying non-authoritative meta tag
get "go.etcd.io/etcd/clientv3/credentials": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/clientv3/credentials?go-get=1
get "go.etcd.io/etcd/clientv3/credentials": verifying non-authoritative meta tag
get "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes?go-get=1
get "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes": verifying non-authoritative meta tag
get "go.etcd.io/etcd/etcdserver/etcdserverpb": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/etcdserver/etcdserverpb?go-get=1
get "go.etcd.io/etcd/etcdserver/etcdserverpb": verifying non-authoritative meta tag
get "go.etcd.io/etcd/mvcc/mvccpb": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/mvcc/mvccpb?go-get=1
get "go.etcd.io/etcd/mvcc/mvccpb": verifying non-authoritative meta tag
get "go.etcd.io/etcd/pkg/logutil": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/pkg/logutil?go-get=1
get "go.etcd.io/etcd/pkg/logutil": verifying non-authoritative meta tag
get "go.etcd.io/etcd/pkg/types": found meta tag get.metaImport{Prefix:"go.etcd.io/etcd", VCS:"git", RepoRoot:"https://github.com/etcd-io/etcd"} at //go.etcd.io/etcd/pkg/types?go-get=1
get "go.etcd.io/etcd/pkg/types": verifying non-authoritative meta tag
github.com/mitchellh/hashstructure (download)
github.com/lucas-clemente/quic-go (download)
github.com/cheekybits/genny (download)
github.com/marten-seemann/qtls (download)
github.com/marten-seemann/chacha20 (download)
github.com/go-acme/lego (download)
github.com/cloudflare/cloudflare-go (download)
github.com/cenkalti/backoff (download)
get "gopkg.in/square/go-jose.v2": found meta tag get.metaImport{Prefix:"gopkg.in/square/go-jose.v2", VCS:"git", RepoRoot:"https://gopkg.in/square/go-jose.v2"} at //gopkg.in/square/go-jose.v2?go-get=1
gopkg.in/square/go-jose.v2 (download)
github.com/gorilla/mux (download)
github.com/joncalhoun/qson (download)
github.com/mholt/certmagic (download)
github.com/klauspost/cpuid (download)
github.com/gorilla/handlers (download)
github.com/bwmarrin/discordgo (download)
github.com/gorilla/websocket (download)
github.com/nlopes/slack (download)
github.com/forestgiant/sliceutil (download)
get "gopkg.in/telegram-bot-api.v4": found meta tag get.metaImport{Prefix:"gopkg.in/telegram-bot-api.v4", VCS:"git", RepoRoot:"https://gopkg.in/telegram-bot-api.v4"} at //gopkg.in/telegram-bot-api.v4?go-get=1
gopkg.in/telegram-bot-api.v4 (download)
github.com/technoweenie/multipartstreamer (download)
github.com/olekukonko/tablewriter (download)
github.com/mattn/go-runewidth (download)
github.com/serenize/snaker (download)
github.com/chzyer/readline (download)
get "golang.org/x/net/context": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at //golang.org/x/net/context?go-get=1
get "golang.org/x/net/context": verifying non-authoritative meta tag
github.com/xlab/treeprint (download)
github.com/hako/branca (download)
github.com/eknkc/basex (download)
github.com/pborman/uuid (download)
golang.org/x/text/unicode/bidi
golang.org/x/text/unicode/norm
github.com/micro/go-micro/registry/cache
github.com/nats-io/nkeys
github.com/micro/go-micro/client/selector
github.com/nats-io/jwt
github.com/micro/go-micro/client/selector/dns
github.com/json-iterator/go
github.com/nats-io/nats.go
golang.org/x/net/idna
github.com/micro/go-micro/broker
google.golang.org/grpc/internal/transport
github.com/micro/go-micro/server
github.com/micro/go-micro/broker/nats
github.com/coreos/etcd/clientv3
# github.com/coreos/etcd/clientv3
../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
../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
../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
../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
../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
../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
../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
../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
../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
../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
../github.com/coreos/etcd/clientv3/auth.go:166:106: too many errors
github.com/micro/go-micro/runtime
github.com/lucas-clemente/quic-go/internal/handshake
golang.org/x/crypto/acme/autocert
github.com/lucas-clemente/quic-go
github.com/micro/go-micro/api/server/acme/autocert
google.golang.org/grpc
github.com/micro/go-micro/store
github.com/micro/go-micro/api/server/acme/certmagic
github.com/micro/go-micro/store/cloudflare
github.com/micro/micro/network/dns/proto/dns
github.com/micro/go-micro/proxy/mucp
github.com/micro/micro/network/dns/provider
github.com/micro/micro/network/dns/handler
github.com/micro/micro/network/dns/provider/cloudflare
github.com/micro/go-micro/util/http
github.com/micro/go-micro/proxy/http
github.com/micro/go-micro/router/service
github.com/micro/go-micro/store/memory
github.com/eknkc/basex
github.com/micro/micro/internal/token/proto
github.com/hako/branca
github.com/pborman/uuid
github.com/micro/micro/internal/token
github.com/micro/micro/token
github.com/micro/go-micro/transport/quic
github.com/micro/go-micro/tunnel
github.com/micro/go-micro/broker/service/proto
github.com/micro/go-micro/client/grpc
github.com/micro/go-micro/registry/service/proto
github.com/micro/go-micro/broker/service
github.com/micro/go-micro/server/grpc
github.com/micro/go-micro/transport/grpc/proto
github.com/micro/go-micro/registry/service
github.com/micro/go-micro/debug/proto
github.com/micro/go-micro/broker/service/handler
github.com/micro/go-micro/transport/grpc
github.com/micro/micro/monitor/proto
github.com/micro/go-micro/network/proto
github.com/micro/go-micro/debug/handler
github.com/micro/go-micro/monitor
github.com/micro/go-micro/tunnel/transport
github.com/micro/micro/monitor/handler
github.com/micro/go-micro/proxy/grpc
github.com/micro/go-micro/registry/service/handler
github.com/micro/go-micro/store/service/proto
github.com/micro/go-micro/network
github.com/micro/go-micro/store/service/handler
github.com/micro/go-micro/network/service/handler
[yangzhao@yangzhaodeMacBook-Pro:] ~/Dev/Gopath/src $

前面出现了错误信息,跑了太多的命令,我也懒得回去找了,再运行一遍 go get -v github.com/micro/micro 看看是什么错误

第二次执行go get

[yangzhao@yangzhaodeMacBook-Pro:] ~/Dev/Gopath/src $go get -v github.com/micro/micro
github.com/coreos/etcd/clientv3
# github.com/coreos/etcd/clientv3
../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
../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
../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
../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
../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
../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
../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
../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
../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
../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
../github.com/coreos/etcd/clientv3/auth.go:166:106: too many errors
[yangzhao@yangzhaodeMacBook-Pro:] ~/Dev/Gopath/src $

好,就是这些错误。

排错

我尝试了很多处理这个错误的方法,过程就不说了,直接来解决方法。(改源码)

打开 sublime,然后shift+command+F 执行内容替换。(WIN:shift+Ctrl+F我猜应该是这个快捷键)

  • 查找内容为:github.com/coreos/etcd/clientv3
  • 查找路径:你 GOPATH 的路径 /src/github.com/micro/go-micro
  • 替换内容为:go.etcd.io/etcd/clientv3

(我改了 8 个文件,10 个位置)

最后把 go.etcd.io/etcd/vendor 这个目录删掉。

第三次执行go get

[yangzhao@yangzhaodeMacBook-Pro:] ~/Dev/Gopath/src $go get -v github.com/micro/micro
github.com/gogo/protobuf (download)
get "go.uber.org/zap": found meta tag get.metaImport{Prefix:"go.uber.org/zap", VCS:"git", RepoRoot:"https://github.com/uber-go/zap"} at //go.uber.org/zap?go-get=1
go.uber.org/zap (download)
get "go.uber.org/atomic": found meta tag get.metaImport{Prefix:"go.uber.org/atomic", VCS:"git", RepoRoot:"https://github.com/uber-go/atomic"} at //go.uber.org/atomic?go-get=1
go.uber.org/atomic (download)
get "go.uber.org/multierr": found meta tag get.metaImport{Prefix:"go.uber.org/multierr", VCS:"git", RepoRoot:"https://github.com/uber-go/multierr"} at //go.uber.org/multierr?go-get=1
go.uber.org/multierr (download)
get "go.uber.org/zap/zapcore": found meta tag get.metaImport{Prefix:"go.uber.org/zap", VCS:"git", RepoRoot:"https://github.com/uber-go/zap"} at //go.uber.org/zap/zapcore?go-get=1
get "go.uber.org/zap/zapcore": verifying non-authoritative meta tag
get "google.golang.org/grpc/resolver/dns": found meta tag get.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at //google.golang.org/grpc/resolver/dns?go-get=1
get "google.golang.org/grpc/resolver/dns": verifying non-authoritative meta tag
google.golang.org/grpc (download)

#这里报错
package google.golang.org/grpc/resolver/dns: cannot find package "google.golang.org/grpc/resolver/dns" in any of:
    /usr/local/go/src/google.golang.org/grpc/resolver/dns (from $GOROOT)
    
    /Users/yangzhao/Dev/Gopath/src/google.golang.org/grpc/resolver/dns (from $GOPATH)
get "google.golang.org/grpc/resolver/passthrough": found meta tag get.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at //google.golang.org/grpc/resolver/passthrough?go-get=1
get "google.golang.org/grpc/resolver/passthrough": verifying non-authoritative meta tag

#这里报错
package google.golang.org/grpc/resolver/passthrough: cannot find package "google.golang.org/grpc/resolver/passthrough" in any of:
    /usr/local/go/src/google.golang.org/grpc/resolver/passthrough (from $GOROOT)
    
    /Users/yangzhao/Dev/Gopath/src/google.golang.org/grpc/resolver/passthrough (from $GOPATH)
github.com/coreos/go-systemd (download)
github.com/coreos/pkg (download)
[yangzhao@yangzhaodeMacBook-Pro:] ~/Dev/Gopath/src $

排错

又报错

经排查,确实是没有 dnspassthrough的目录

进入 github https://github.com/grpc/grpc-go,查看它的源码,master下确实没有 dns,但是分支1.24.x 下有,我下载了这个分支的源码,并替换我现有的文件。

第四次执行go get

[yangzhao@yangzhaodeMacBook-Pro:] ~/Dev/Gopath/src $go get -v github.com/micro/micro
google.golang.org/grpc/grpclog
google.golang.org/grpc/credentials
google.golang.org/grpc/encoding
google.golang.org/grpc/internal/backoff
google.golang.org/grpc/encoding/proto
google.golang.org/grpc/internal
google.golang.org/grpc/internal/channelz
google.golang.org/grpc/peer
google.golang.org/grpc/serviceconfig
google.golang.org/grpc/status
google.golang.org/grpc/resolver
google.golang.org/grpc/internal/binarylog
google.golang.org/grpc/balancer
google.golang.org/grpc/resolver/dns
google.golang.org/grpc/balancer/base
google.golang.org/grpc/balancer/roundrobin
google.golang.org/grpc/resolver/passthrough
go.uber.org/atomic
github.com/gogo/protobuf/proto
google.golang.org/grpc/internal/transport
go.uber.org/zap/buffer
go.uber.org/zap/internal/bufferpool
go.uber.org/multierr
go.uber.org/zap/internal/color
go.uber.org/zap/internal/exit
go.etcd.io/etcd/clientv3/balancer/resolver/endpoint
go.uber.org/zap/zapcore
go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes
go.etcd.io/etcd/clientv3/credentials
github.com/coreos/go-systemd/journal
github.com/coreos/pkg/capnslog
go.uber.org/zap
go.etcd.io/etcd/clientv3/balancer/connectivity
go.etcd.io/etcd/clientv3/balancer/picker
go.etcd.io/etcd/clientv3/balancer
google.golang.org/grpc
github.com/micro/go-micro/broker/service/proto
github.com/micro/go-micro/registry/service/proto
github.com/micro/go-micro/client/grpc
github.com/micro/go-micro/broker/service
github.com/micro/go-micro/server/grpc
github.com/micro/go-micro/registry/service
github.com/micro/go-micro/transport/grpc/proto
github.com/micro/go-micro/debug/proto
github.com/micro/go-micro/transport/grpc
github.com/micro/go-micro/debug/handler
github.com/micro/go-micro/broker/service/handler
github.com/micro/go-micro/monitor
github.com/micro/micro/monitor/proto
github.com/micro/go-micro/network/proto
github.com/micro/micro/monitor/handler
github.com/micro/go-micro/proxy/grpc
github.com/micro/go-micro/registry/service/handler
github.com/micro/go-micro/store/service/proto
github.com/micro/go-micro/network
github.com/micro/go-micro/store/service/handler
github.com/gogo/protobuf/protoc-gen-gogo/descriptor
github.com/micro/go-micro/network/service/handler
github.com/gogo/protobuf/gogoproto
go.etcd.io/etcd/auth/authpb
go.etcd.io/etcd/mvcc/mvccpb
go.etcd.io/etcd/raft/raftpb
go.etcd.io/etcd/etcdserver/etcdserverpb
go.etcd.io/etcd/raft/tracker
go.etcd.io/etcd/raft/confchange
go.etcd.io/etcd/raft
go.etcd.io/etcd/pkg/logutil
go.etcd.io/etcd/clientv3
github.com/micro/go-micro/registry/etcd
github.com/micro/go-micro/config/cmd
github.com/micro/go-micro/plugin
github.com/micro/micro/internal/command/cli
github.com/micro/go-micro/api/router/registry
github.com/micro/micro/plugin/build
github.com/micro/go-micro
github.com/micro/micro/internal/command/bot
github.com/micro/micro/cli
github.com/micro/micro/monitor
github.com/micro/micro/broker
github.com/micro/micro/health
github.com/micro/micro/api
github.com/micro/micro/network/api
github.com/micro/micro/network/dns
github.com/micro/go-micro/web
github.com/micro/micro/proxy
github.com/micro/micro/registry
github.com/micro/micro/server
github.com/micro/micro/service
github.com/micro/micro/network/web
github.com/micro/micro/store
github.com/micro/micro/network
github.com/micro/micro/tunnel
github.com/micro/micro/web
github.com/micro/micro/cmd
github.com/micro/micro
[yangzhao@yangzhaodeMacBook-Pro:] ~/Dev/Gopath/src

终于成功的跑完了命令,bin目录下也成功的生成 micro 文件了。

这里介绍了我的解决方法。

本来我是使用 go mod 的,go mod模式下直接就可以下载安装好第三方库,但是由于项目需要大量的自动生成代码,并且受限于GOPATH,没办法的又改回来了。

正文完
 0