Go:go

编程入门 行业动态 更新时间:2024-10-20 09:32:48

Go:go

Go:go

Go:go-chassis 第三方依赖包问题

1.下载 go-chassis 源码

test1280 $ git clone 
Initialized empty Git repository in /home/test1280/go-chassis/.git/
remote: Enumerating objects: 53, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 7132 (delta 8), reused 22 (delta 7), pack-reused 7079
Receiving objects: 100% (7132/7132), 2.59 MiB | 37 KiB/s, done.
Resolving deltas: 100% (4250/4250), done.

2.安装 go-chassis 源码

test1280 $ cd go-chassis/
test1280 $ go mod download
go: finding github/go-chassis/paas-lager v0.0.0-20181123014243-005283cca84c
go: finding github/hashicorp/go-version v1.0.0
go: finding github/prometheus/common v0.2.0
go: finding github/golang/snappy v0.0.1
go: finding github/opentracing/opentracing-go v1.0.2
go: github/prometheus/common@v0.2.0: unknown revision v0.2.0
go: github/hashicorp/go-version@v1.0.0: unknown revision v1.0.0
go: finding github/emicklei/go-restful v2.8.0+incompatible
go: finding github/patrickmn/go-cache v2.1.0+incompatible
go: github/golang/snappy@v0.0.1: unknown revision v0.0.1
go: github/emicklei/go-restful@v2.8.0+incompatible: unknown revision v2.8.0
go: github/opentracing/opentracing-go@v1.0.2: unknown revision v1.0.2
go: github/patrickmn/go-cache@v2.1.0+incompatible: unknown revision v2.1.0
go: finding github/smartystreets/goconvey v0.0.0-20170602164621-9e8dc3f972df
go: finding github/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165
go: finding github/stretchr/testify v1.2.2
……

有很多 unknown version,解决方法。

3.继续执行 go mod download

[test1280@localhost go-chassis]$ go mod download
go: finding github/go-chassis/paas-lager v0.0.0-20181123014243-005283cca84c
go: finding github/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1
go: finding github/cenkalti/backoff v2.0.0+incompatible
go: finding github/go-chassis/foundation v0.0.0-20190203091418-304855ea28bf
go: finding github/hashicorp/go-version v1.0.0
go: finding github/patrickmn/go-cache v2.1.0+incompatible
go: finding github/golang/snappy v0.0.1
go: finding github/smartystreets/goconvey v0.0.0-20170602164621-9e8dc3f972df
go: finding gopkg.in/yaml.v2 v2.2.1
go: finding github/prometheus/common v0.2.0
go: finding github/gogo/protobuf v1.2.0
go: finding github/prometheus/client_model v0.0.0-20190115171406-56726106282f
go: finding github/go-chassis/go-restful-swagger20 v0.0.0-20181221101811-a33c76fe4a6e
go: finding github/go-mesh/openlogging v0.0.0-20181122085847-3daf3ad8ed35
go: finding github/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165
go: finding github/golang/protobuf v1.2.0
go: finding github/go-logfmt/logfmt v0.4.0
go: finding github/emicklei/go-restful v2.8.0+incompatible
go: finding github/gorilla/websocket v1.4.0
go: finding github/stretchr/testify v1.2.2
go: finding github/go-stack/stack v1.8.0
go: finding github/matttproud/golang_protobuf_extensions v1.0.1
go: finding github/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304
go: go.uber/ratelimit@v0.0.0-20180316092928-c15da0234277: unrecognized import path "go.uber/ratelimit" (https fetch: Get =1: dial tcp 172.217.25.19:443: connect: connection refused)
go: finding github/sirupsen/logrus v1.2.0
go: finding github/prometheus/client_golang v0.9.1
go: finding github/json-iterator/go v1.1.5
go: finding github/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: golang/x/net@v0.0.0-20181114220301-adae6a3d119a: unrecognized import path "golang/x/net" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: finding github/gogo/protobuf v1.1.1
go: finding github/alecthomas/units v0.0.0-20151022065526-2efee857e7cf
go: finding github/modern-go/reflect2 v1.0.1
go: finding github/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223
go: finding github/beorn7/perks v0.0.0-20180321164747-3a771d992973
go: finding github/go-chassis/go-cc-client v0.5.0
go: finding github/julienschmidt/httprouter v1.2.0
go: finding github/pierrec/lz4 v2.0.5+incompatible
go: google.golang/grpc@v1.16.0: unrecognized import path "google.golang/grpc" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: finding github/pkg/errors v0.8.0
go: finding github/kr/logfmt v0.0.0-20140226030751-b84e30acd515
go: finding github/opentracing/opentracing-go v1.0.2
go: finding github/prometheus/client_model v0.0.0-20180712105110-5c3871d89910
go: finding gopkg.in/alecthomas/kingpin.v2 v2.2.6
go: finding github/go-chassis/go-archaius v0.7.0
go: finding github/go-kit/kit v0.8.0
go: finding github/prometheus/procfs v0.0.0-20181005140218-185b4288413d
go: finding github/go-logfmt/logfmt v0.3.0
go: finding github/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: golang/x/sync@v0.0.0-20181108010431-42b317875d0f: unrecognized import path "golang/x/sync" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: golang/x/sys@v0.0.0-20181116152217-5ac8a444bdc5: unrecognized import path "golang/x/sys" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
^C
[test1280@localhost go-chassis]$ 

Q1:

go: golang/x/net@v0.0.0-20181114220301-adae6a3d119a: unrecognized import path "golang/x/net" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)

针对此问题,执行:

[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/net@v0.0.0-20181114220301-adae6a3d119a=github/golang/net@v0.0.0-20181114220301-adae6a3d119a

即将 golang 映射到 github 项目中。

Q2:

go: google.golang/grpc@v1.16.0: unrecognized import path "google.golang/grpc" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)

针对此问题,执行:

[test1280@localhost go-chassis]$ go mod edit -replace=google.golang/grpc@v1.16.0=github/grpc/grpc-go@v1.16.0

即将 google.golang 映射到 github 项目中。

Q3:

go: golang/x/sync@v0.0.0-20181108010431-42b317875d0f: unrecognized import path "golang/x/sync" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: golang/x/sys@v0.0.0-20181116152217-5ac8a444bdc5: unrecognized import path "golang/x/sys" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)

同 Q1 解决:

[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/sync@v0.0.0-20181108010431-42b317875d0f=github/golang/sync@v0.0.0-20181108010431-42b317875d0f
[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/sys@v0.0.0-20181116152217-5ac8a444bdc5=github/golang/sys@v0.0.0-20181116152217-5ac8a444bdc5

4.继续执行 go mod download 试试看!

[test1280@localhost go-chassis]$ go mod download
go: finding github/pierrec/lz4 v2.0.5+incompatible
go: finding github/go-chassis/go-cc-client v0.3.0
go: finding github/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc
go: finding github/spf13/cast v1.2.0
go: finding github/golang/net v0.0.0-20181114220301-adae6a3d119a
go: finding github/fsnotify/fsnotify v1.4.7
go: finding github/grpc/grpc-go v1.16.0
go: finding github/golang/sys v0.0.0-20181116152217-5ac8a444bdc5
go: gopkg.in/check.v1@v0.0.0-20161208181325-20d25e280405: unrecognized import path "gopkg.in/check.v1" (https fetch: Get .v1?go-get=1: net/http: TLS handshake timeout)
go: finding github/go-kit/kit v0.8.0
go: go.uber/ratelimit@v0.0.0-20180316092928-c15da0234277: unrecognized import path "go.uber/ratelimit" (https fetch: Get =1: dial tcp 172.217.25.19:443: connect: connection refused)
go: finding github/gogo/protobuf v1.1.1
go: github/go-chassis/go-cc-client@v0.3.0: unknown revision v0.3.0
go: finding github/golang/sync v0.0.0-20181108010431-42b317875d0f
go: finding github/go-chassis/go-chassis v1.2.2
go: github/fsnotify/fsnotify@v1.4.7: unknown revision v1.4.7
go: github/go-kit/kit@v0.8.0: unknown revision v0.8.0
go: github/gogo/protobuf@v1.1.1: unknown revision v1.1.1
go: error loading module requirements

注意:

go: go.uber/ratelimit@v0.0.0-20180316092928-c15da0234277: unrecognized import path "go.uber/ratelimit" (https fetch: Get =1: dial tcp 172.217.25.19:443: connect: connection refused)

虽然有其他报错,但是我们先尝试解决已知的问题。有时候已知问题解决,其他奇奇怪怪的问题也就解决啦!

[test1280@localhost go-chassis]$ go mod edit -replace=go.uber/ratelimit@v0.0.0-20180316092928-c15da0234277=github/uber-go/ratelimit@v0.0.0-20180316092928-c15da0234277

5.继续执行 go mod download

[test1280@localhost go-chassis]$ go mod download
go: finding github/gogo/protobuf v1.1.1
go: finding github/go-chassis/go-cc-client v0.3.0
go: finding github/go-kit/kit v0.8.0
go: finding github/uber-go/ratelimit v0.0.0-20180316092928-c15da0234277
go: finding github/golang/mock v1.1.1
go: finding github/pmezard/go-difflib v1.0.0
go: finding github/stretchr/objx v0.1.1
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: finding honnef.co/go/tools v0.0.0-20180728063816-88497007e858
go: finding github/davecgh/go-spew v1.1.1
go: finding github/prometheus/common v0.0.0-20190107103113-2998b132700a
go: finding github/prometheus/procfs v0.0.0-20190104112138-b1a0a9a36d74
go: finding github/DataDog/zstd v1.3.5
go: finding github/golang/glog v0.0.0-20160126235308-23def4e6c14b
go: finding github/fsnotify/fsnotify v1.4.7
go: finding github/client9/misspell v0.3.4
go: finding github/golang/text v0.3.0
go: finding github/google/go-genproto v0.0.0-20180817151627-c66870c02cf8
go: finding github/go-chassis/go-cc-client v0.0.0-20181102101915-dea430061a34
go: finding github/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e
go: cloud.google/go@v0.26.0: unrecognized import path "cloud.google/go" (https fetch: Get =1: dial tcp 216.58.195.78:443: connect: connection refused)
go: golang/x/tools@v0.0.0-20180828015842-6cd1fcedba52: unrecognized import path "golang/x/tools" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: finding github/jtolds/gls v4.2.1+incompatible
go: google.golang/genproto@v0.0.0-20181221175505-bd9b4fb69e2f: unrecognized import path "google.golang/genproto" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: finding github/kisielk/gotool v1.0.0
go: google.golang/appengine@v1.1.0: unrecognized import path "google.golang/appengine" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: golang/x/net@v0.0.0-20180826012351-8a410e7b638d: unrecognized import path "golang/x/net" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: finding github/go-chassis/go-archaius v0.0.0-20181108111652-ab19b4eae276
go: golang/x/oauth2@v0.0.0-20180821212333-d2e6202438be: unrecognized import path "golang/x/oauth2" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: finding github/golang/snappy v0.0.0-20180518054509-2e65f85255db
go: golang/x/sys@v0.0.0-20180905080454-ebe1bf3edb33: unrecognized import path "golang/x/sys" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: golang/x/sys@v0.0.0-20180830151530-49385e6e1522: unrecognized import path "golang/x/sys" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: finding github/openzipkin-contrib/zipkin-go-opentracing v0.0.0-20180726151020-b85dc675b16b
go: finding github/konsorten/go-windows-terminal-sequences v1.0.1
go: finding github/golang/lint v0.0.0-20180702182130-06c8688daad7
go: golang/x/sync@v0.0.0-20180314180146-1d60e4601c6f: unrecognized import path "golang/x/sync" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: finding github/eapache/queue v1.1.0
go: finding github/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21
go: finding github/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d
go: finding github/Shopify/sarama v1.20.1
go: finding github/apache/thrift v0.0.0-20180829120307-8de3749235db
go: finding github/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492
go: finding github/eapache/go-resiliency v1.1.0
go: golang/x/lint@v0.0.0-20180702182130-06c8688daad7: unrecognized import path "golang/x/lint" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: golang/x/crypto@v0.0.0-20180904163835-0709b304e793: unrecognized import path "golang/x/crypto" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: error loading module requirements

回到最初的原点(Q1),执行:

[test1280@localhost go-chassis]$ go mod edit -replace=cloud.google/go@v0.26.0=github/GoogleCloudPlatform/google-cloud-go@v0.26.0
[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/tools@v0.0.0-20180828015842-6cd1fcedba52=github/golang/tools@v0.0.0-20180828015842-6cd1fcedba52
[test1280@localhost go-chassis]$ go mod edit -replace=google.golang/genproto@v0.0.0-20181221175505-bd9b4fb69e2f=github/google/go-genproto@v0.0.0-20181221175505-bd9b4fb69e2f
[test1280@localhost go-chassis]$ go mod edit -replace=google.golang/appengine@v1.1.0=github/golang/appengine@v1.1.0
[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/net@v0.0.0-20180826012351-8a410e7b638d=github/golang/net@v0.0.0-20180826012351-8a410e7b638d
[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/oauth2@v0.0.0-20180821212333-d2e6202438be=github/golang/oauth2@v0.0.0-20180821212333-d2e6202438be
[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/sys@v0.0.0-20180905080454-ebe1bf3edb33=github/golang/sys@v0.0.0-20180905080454-ebe1bf3edb33
[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/sys@v0.0.0-20180830151530-49385e6e1522=github/golang/sys@v0.0.0-20180830151530-49385e6e1522
[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/sync@v0.0.0-20180314180146-1d60e4601c6f=github/golang/sync@v0.0.0-20180314180146-1d60e4601c6f
[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/lint@v0.0.0-20180702182130-06c8688daad7=github/golang/lint@v0.0.0-20180702182130-06c8688daad7
[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/crypto@v0.0.0-20180904163835-0709b304e793=github/golang/crypto@v0.0.0-20180904163835-0709b304e793

6.继续执行 go mod download

[test1280@localhost go-chassis]$ go mod download
go: finding github/golang/net v0.0.0-20180826012351-8a410e7b638d
go: finding github/golang/sync v0.0.0-20180314180146-1d60e4601c6f
go: finding github/golang/sys v0.0.0-20180830151530-49385e6e1522
go: finding github/go-mesh/openlogging v0.0.0-20180912071658-0fd4707a75ab
go: finding github/golang/sys v0.0.0-20180824143301-4910a1d54f87
go: finding github/google/go-genproto v0.0.0-20181221175505-bd9b4fb69e2f
go: finding github/golang/oauth2 v0.0.0-20180821212333-d2e6202438be
go: finding github/golang/sys v0.0.0-20180905080454-ebe1bf3edb33
go: finding github/golang/appengine v1.1.0
go: finding github/golang/tools v0.0.0-20180828015842-6cd1fcedba52
go: finding github/GoogleCloudPlatform/google-cloud-go v0.26.0
go: finding github/go-chassis/go-chassis v1.0.2-0.20181108080311-6e96c66de2a1
go: finding github/golang/crypto v0.0.0-20180904163835-0709b304e793
go: golang/x/net@v0.0.0-20181106065722-10aee1819953: unrecognized import path "golang/x/net" (https fetch: Get =1: dial tcp 216.239.37.1:443: connect: connection refused)
go: error loading module requirements

执行:

[test1280@localhost go-chassis]$ go mod edit -replace=golang/x/net@v0.0.0-20181106065722-10aee1819953=github/golang/net@v0.0.0-20181106065722-10aee1819953
[test1280@localhost go-chassis]$ go mod download
go: finding github/golang/net v0.0.0-20181106065722-10aee1819953
go: finding github/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf
go: finding github/prometheus/common v0.0.0-20181015124227-bcb74de08d37
go: finding github/prometheus/procfs v0.0.0-20180920065004-418d78d0b9a7
go: finding github/lyft/protoc-gen-validate v0.0.7
go: finding github/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f
go: finding github/emicklei/go-restful-swagger12 v0.0.0-20170208215640-dcef7f557305
go: finding github/cactus/go-statsd-client v3.1.1+incompatible
go: finding github/envoyproxy/go-control-plane v0.5.0
go: finding github/shirou/gopsutil v0.0.0-20180801053943-8048a2e9c577
go: finding github/golang/net v0.0.0-20180824152047-4bcd98cce591
go: finding github/go-chassis/go-sc-client v0.0.0-20180925063328-78ad13b4fbef
go: finding github/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a
go: finding github/Shopify/sarama v1.18.0
go: finding github/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c
go: finding github/go-mesh/openlogging v0.0.0-20180831021158-f5d1c4e7e506
go: finding github/grpc/grpc-go v1.14.0
go: finding github/spf13/pflag v1.0.3
go: k8s.io/apimachinery@v0.0.0-20180823151430-017bf4f8f588: unrecognized import path "k8s.io/apimachinery" (https fetch: Get =1: net/http: TLS handshake timeout)
go: finding github/prometheus/client_golang v0.8.0
go: k8s.io/client-go@v9.0.0+incompatible: unrecognized import path "k8s.io/client-go" (https fetch: Get =1: net/http: TLS handshake timeout)
go: finding github/go-chassis/paas-lager v0.0.0-20180905100939-eff93e5e67db
go: finding github/go-chassis/paas-lager v0.0.0-20180831030822-312e8737a225
go: github/envoyproxy/go-control-plane@v0.5.0: unknown revision v0.5.0
go: finding github/hashicorp/golang-lru v0.5.0
go: github/Shopify/sarama@v1.18.0: unknown revision v1.18.0
go: finding github/go-chassis/go-archaius v0.0.0-20181102103750-3dfd20d229f6
go: finding github/gorilla/websocket v1.3.0
go: github/lyft/protoc-gen-validate@v0.0.7: unknown revision v0.0.7
go: k8s.io/api@v0.0.0-20180925152912-a191abe0b71e: unrecognized import path "k8s.io/api" (https fetch: Get =1: net/http: TLS handshake timeout)
go: github/hashicorp/golang-lru@v0.5.0: unknown revision v0.5.0
go: github/StackExchange/wmi@v0.0.0-20180725035823-b12b22c5341f: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/test1280/go/pkg/mod/cache/vcs/1e27c85e821f18cfbbce893a068065af7efff4ab86f7daf2a8de26813b7ffe62: exit status 128:fatal: unable to access '/': SSL connect error
go: github/prometheus/common@v0.0.0-20181015124227-bcb74de08d37: git -c protocol.version=0 fetch --unshallow -f  refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/test1280/go/pkg/mod/cache/vcs/78eeb4629eb558fa221be26a69bd8019d99c56c9d5e61a056019c7d4845bf714: exit status 128:fatal: unable to access '/': SSL connect error
go: github/gorilla/websocket@v1.3.0: unknown revision v1.3.0
go: github/cactus/go-statsd-client@v3.1.1+incompatible: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/test1280/go/pkg/mod/cache/vcs/c0920b8850964a068a863a13f0f10214cf863ff6a1adde6126d9cdef65ca3bb4: exit status 128:fatal: unable to access '/': SSL connect error
go: github/spf13/pflag@v1.0.3: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/test1280/go/pkg/mod/cache/vcs/389cbbf79b0218a16e6f902e349b1cabca23e0203c06f228d24031e72b6cf480: exit status 128:fatal: unable to access '/': SSL connect error
go: github/gopherjs/gopherjs@v0.0.0-20180825215210-0210a2f0f73c: git -c protocol.version=0 fetch --unshallow -f  refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/test1280/go/pkg/mod/cache/vcs/64690fb57f6c8566e98dbafa66110e0252c9a4adabb2d9f72d8c1723eb6637ad: exit status 128:fatal: unable to access '/': SSL connect error
go: error loading module requirements

执行:

[test1280@localhost go-chassis]$ go mod edit -replace=k8s.io/apimachinery@v0.0.0-20180823151430-017bf4f8f588=github/kubernetes/apimachinery@v0.0.0-20180823151430-017bf4f8f588
[test1280@localhost go-chassis]$ go mod download
go: finding github/hashicorp/golang-lru v0.5.0
go: finding github/Shopify/sarama v1.18.0
go: finding github/envoyproxy/go-control-plane v0.5.0
go: finding github/cactus/go-statsd-client v3.1.1+incompatible
go: finding github/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c
go: finding github/spf13/pflag v1.0.3
go: finding github/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f
go: finding github/lyft/protoc-gen-validate v0.0.7
go: finding github/prometheus/common v0.0.0-20181015124227-bcb74de08d37
go: finding github/kubernetes/apimachinery v0.0.0-20180823151430-017bf4f8f588
go: finding github/go-chassis/go-chassis v0.8.3
go: finding github/go-chassis/go-chassis-plugins v0.0.0-20180731065901-7b05d8d2fbe6
go: finding github/go-ole/go-ole v1.2.1
go: finding github/json-iterator/go v0.0.0-20180806060727-1624edc4454b
go: finding github/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47
go: finding github/imdario/mergo v0.3.6
go: finding github/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
go: finding github/pierrec/lz4 v2.0.3+incompatible
go: finding github/go-chassis/go-sc-client v0.0.0-20180831081217-8135c6df7f96
go: finding github/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
go: finding github/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c
go: k8s.io/client-go@v9.0.0+incompatible: unrecognized import path "k8s.io/client-go" (https fetch: Get =1: net/http: TLS handshake timeout)
go: finding github/gopherjs/gopherjs v0.0.0-20180820052304-89baedc74dd7
go: finding github/gorilla/websocket v1.3.0
go: finding k8s.io/api v0.0.0-20180824172530-dd5c735cbff9
go: finding k8s.io/api v0.0.0-20180925152912-a191abe0b71e
go: finding github/smartystreets/assertions v0.0.0-20180301161246-7678a5452ebe
go: finding github/peterbourgon/diskv v2.0.1+incompatible
go: finding github/gogo/googleapis v1.1.0
go: finding github/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273
go: finding github/google/gofuzz v0.0.0-20170612174753-24818f796faf
go: finding github/ghodss/yaml v1.0.0
go: finding github/spf13/pflag v1.0.2
go: k8s.io/client-go@v8.0.0+incompatible: unrecognized import path "k8s.io/client-go" (https fetch: Get =1: net/http: TLS handshake timeout)
go: finding github/golang/time v0.0.0-20180412165947-fbb02b2291d2
go: finding github/prometheus/common v0.0.0-20180801064454-c7de2306084e
go: finding github/google/btree v0.0.0-20180813153112-4030bb1f1f0c
go: finding github/lyft/protoc-gen-validate v0.0.6
go: finding github/go-chassis/go-archaius v0.0.0-20180831094429-1e6b20d2a085
go: finding github/go-chassis/go-cc-client v0.0.0-20180831085349-c2bb6cef1640
go: finding github/googleapis/gnostic v0.2.0
go: gopkg.in/inf.v0@v0.9.1: unrecognized import path "gopkg.in/inf.v0" (https fetch: Get .v0?go-get=1: net/http: TLS handshake timeout)
go: finding github/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4
go: finding github/Shopify/sarama v1.17.0
go: finding github/golang/crypto v0.0.0-20180820150726-614d502a4dac
go: finding github/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6
go: error loading module requirements

执行:

[test1280@localhost go-chassis]$ go mod edit -replace=k8s.io/client-go@v9.0.0=github/kubernetes/client-go@v9.0.0
[test1280@localhost go-chassis]$ go mod download
go: finding k8s.io/client-go v9.0.0
go: finding github/kubernetes/client-go v9.0.0
go: finding k8s.io/client-go v8.0.0+incompatible
go: finding gopkg.in/inf.v0 v0.9.1
go: finding golang/x/crypto v0.0.0-20180904163835-0709b304e793
go: finding golang/x/lint v0.0.0-20180702182130-06c8688daad7
go: finding golang/x/net v0.0.0-20181114220301-adae6a3d119a
go: finding golang/x/oauth2 v0.0.0-20180821212333-d2e6202438be
go: finding golang/x/sync v0.0.0-20181108010431-42b317875d0f
go: finding golang/x/sys v0.0.0-20181116152217-5ac8a444bdc5
go: finding golang/x/text v0.3.0
go: finding golang/x/tools v0.0.0-20180828015842-6cd1fcedba52

综上,在安装过程中会出现很多奇怪的问题,我们先捡我们熟悉的问题解决掉它,其他问题通常也就解决了。

总结:将被墙的第三方项目依赖包映射到 github 中对应的项目地址。


后记

问题

[test1280@localhost ~]$ cd $HOME/go-chassis/examples/rest/server
[test1280@localhost server]$ go build
go: github/golang/lint@v0.0.0-20180702182130-06c8688daad7 used for two different module paths (github/golang/lint and golang/x/lint)

解决

[test1280@localhost server]$ cd $HOME/go-chassis/
[test1280@localhost go-chassis]$ go get github/golang/lint@latest
go: finding github/golang/lint latest
go: downloading github/golang/lint v0.0.0-20190301231843-5614ed5bae6f

再次尝试 go build 即可编译成功。

更多推荐

Go:go

本文发布于:2024-03-06 14:36:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1715566.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!