1

我想从私有 golang 注册表中获取我的依赖项。

通过使用GOPROXY.

我想确保所有依赖项都来自该私有注册表。

我现在找到的唯一方法是做

go get -v -t  github.com/opentracing/opentracing-go@fakeversion

哪个会回来

go get: github.com/opentracing/opentracing-go@fakeversion: invalid version: reading  http://myprivateregistry.com 404 Not found

如果不这样做,我怎样才能获得它的注册表?

4

1 回答 1

1

go get您可以使用go get -v -x <package>(可以省略)进行跟踪-v并检查请求是否符合您的期望:

$ go get -v -x
# get https://myinternalproxy.com/github.com/@v/list
# get https://myinternalproxy.com/github.com/gin-gonic/gin/@v/list
# get https://myinternalproxy.com/github.com/gin-gonic/@v/list
# get https://myinternalproxy.com/github.com/stretchr/testify/require/@v/list
# get https://myinternalproxy.com/github.com/stretchr/testify/assert/@v/list
# get https://myinternalproxy.com/github.com/stretchr/testify/@v/list
# get https://myinternalproxy.com/github.com/stretchr/@v/list
# get https://myinternalproxy.com/github.com/stretchr/@v/list: 410 Gone (0.462s)
# get https://myinternalproxy.com/github.com/gin-gonic/@v/list: 410 Gone (0.466s)
# get https://myinternalproxy.com/github.com/@v/list: 410 Gone (0.466s)
... much more logs
于 2021-04-16T23:54:49.783 回答