我想要需要私有 azure 存储库的特定模块。该模块位于所述存储库的子目录中。这会导致所需的模块在模块路径中包含不需要的
[...].git/[...]
。
按照 Microsoft HTTPS 文档,我能够获取完整的存储库,但在需要子目录时遇到以下问题。
.gitconfig
[url "https://user.name:[email protected]/company/project/_git/repo"]
insteadOf = https://dev.azure.com/company/project/_git/repo
转为私有
"GOPRIVATE": "dev.azure.com"
示例1
go get dev.azure.com/company/project/_git/repo.git/go
go: module dev.azure.com/company/project/_git/repo.git@upgrade found (v0.0.0), but does not contain package dev.azure.com/company/project/_git/repo.git/go
期待
require dev.azure.com/company/project/_git/repo/go
示例2
go get dev.azure.com/company/project/_git/repo.git/go/pkg/mypkg@feature/#99999/mybranch
go: dev.azure.com/company/project/_git/repo.git/go/pkg/mypkg@feature/#98667/mybranch (v0.0.0) requires dev.azure.com/company/project/_git/repo.git/go/pkg/[email protected]: parsing go.mod:
module declares its path as: dev.azure.com/company/project/_git/repo/go/pkg/mypkg
but was required as: dev.azure.com/company/project/_git/repo.git/go/pkg/mypkg
期待
require dev.azure.com/company/project/_git/repo/go/pkg/mypkg
在 Go 模块的存储库中,打开子文件夹“
go
”并确保“go.mod
”文件存在。
module go
go 1.14