Closed Gold-yuan closed 9 months ago
你好。
我想知道,可以引用子项目的功能是goproxy代理做的,还是github本身支持的?
这个跟走没走 goproxy 是无关的,Go modules 是允许你这种 nested modules 的。
问题应该是出在了你的 VCS 那边,建议打开那边的日志看一下请求路径之类的是否满足要求。
另外,在使用 go get
、go mod download
、go mod tidy
等命令的时候,可以加 -x
flag 来打印 go 具体执行的操作(比如发出了哪些请求之类的),方便调试。
鉴于长时间未回复,这个 issue 我就先关闭了,如果还有其他问题欢迎随时提问。
我的项目结构如下: gomodtest .
├── go.mod
├── go.sum
├── main.go
└── utils
├── go.mod
└── utils.go
现在我在github上可以使用gomod正常的引用 gomodtest/utils像下面这样:
require github.com/Gold-yuan/gomodtest/utils v0.0.0-20231208055322-99a5ec6f3f7b
但我把我的代码放在私有的gitlab上时,我可以引用github.com/Gold-yuan/gomodtest
主项目,不能引用子项目了。 我想知道,可以引用子项目的功能是goproxy代理做的,还是github本身支持的?在我本地将
github.com
host映射到我的nginx转发如下方这样: