由于公司电脑不能连接外网。
将 go mod 项目和 vendor 文件夹拷贝过去后,goland 不能识别依赖包。
如果将 go mod 生成的 gopath 的依赖也拷贝过去就可以了,
现在能不能不拷贝依赖也能让 goland 识别呢?
有没有大佬遇到过类似问题呢?
1
AmrtaShiva 2020 年 5 月 21 日
估计搞不了
|
2
JackyCDK 2020 年 5 月 21 日
。。。。replace 每个直接定位一遍?
|
3
to2false 2020 年 5 月 21 日
> 将 go mod 项目和 vendor 文件夹拷贝过去后,goland 不能识别依赖包。
可以识别的,goland 里设置成 vendor 模式就行了 |
4
popstk 2020 年 5 月 21 日
1. 原机 go mod vendor
2. 整个目录拷贝到新机 3. goland 的 File->Settings->Go->Go Modules 的 vendoring support 勾起来 |
5
log4j 2020 年 5 月 21 日
把三方包放到 vendor 就行了,能不能识别是你 IDE 设置的问题,只要用 vendor build 没问题就可以
|
6
janxin 2020 年 5 月 21 日
可以识别的,应该是配置不对导致的
|
7
scnace 2020 年 5 月 21 日 via Android
在能连外网的机器上搭个 Go Proxy
|
8
kkkwar 2020 年 5 月 21 日
go build -mod=vendor
|
9
saberlong 2020 年 5 月 21 日 via Android
本地建 athens 之类的仓库存放第三方包。然后自己建 github,gitea 之类的作没内部项目的包。不过没外网,怎么取第三方包是问题
|
10
BlackBerry999 2020 年 5 月 21 日
内网搭私有库
|
11
mainjzb 2020 年 5 月 21 日
replace 直接定位到本地目录把
replace github.com/xxxx/xxSDK => C:/git/xxSDK |