我在👉🏻克隆链接上有私人bitbucket仓库http://localhost:7990 http://localhost:7990/scm/gom/bar.git
go.mod好像:
module mod.org/bar
go 1.13
远程存储库中可用的参考:
git ls-remote http://localhost:7990/scm/gom/bar.git
From http://localhost:7990/scm/gom/bar.git
d456de4f12785b26ac27ba08cffb76687d1287c8 HEAD
d456de4f12785b26ac27ba08cffb76687d1287c8 refs/heads/master
f948bd47a22c5fb9abed5bff468a10fc24f67483 refs/tags/v1.0.0
我.gitconfig改为
[url "http://localhost:7990/scm/gom"]
insteadOf = https://mod.org
并试图通过 获取模块name,得到 no such host错误:
go get -v mod.org/bar
go get lmod.org/bar: unrecognized import path "lmod.org/bar" (https fetch: Get https://lmod.org/bar?go-get=1: dial tcp: lookup lmod.org: no such host)
当我添加扩展名时.git
go get -v mod.org/bar.git
go: finding lmod.org/bar.git v1.0.0
go: downloading lmod.org/bar.git v1.0.0
verifying lmod.org/bar.git@v1.0.0: lmod.org/bar.git@v1.0.0: reading https://sum.golang.org/lookup/lmod.org/bar.git@v1.0.0: 410 Gone
go下载带有标签v1.0.0的版本GOPATH = /Users/user/go":
$GOPATH
└── go
└── pkg
└── mod
└── cache
└── download
└── mod.org
└── bar.git
└── @v
├── v1.0.0.info
├── v1.0.0.lock
└── v1.0.0.zip.tmp882433775
,但我仍然无法在其他 go-project 中使用它作为依赖项。
ABOUTYOU
达令说
陪伴而非守候
相关分类