網站首頁 編程語言 正文
golang導入私有倉庫報錯:“server response: not found:xxx: invalid version: git ls-remote -q origin in xxx“
作者:王建文 更新時間: 2022-05-06 編程語言1.問題:go get導入私有倉庫報錯
? go get "devops.gitlab.xxx.com/test/kafka-utils"
go: devops.gitlab.xxx.com/test/kafka-utils@v0.0.1: verifying go.mod: devops.gitlab.xxx.com/testo/kafka-utils@v0.0.1/go.mod: reading https://goproxy.cn/sumdb/sum.golang.org/lookup/devops.gitlab.xxx.com/test/kafka-utils@v0.0.1: 404 Not Found
server response:
not found: devops.gitlab.xxx.com/test/kafka-utils@v0.0.1: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/4eca6870c5eba21f85d126a33da76e0445c3741603369eb6c7037cbbb88e9a16: exit status 128:
fatal: could not read Username for 'https://devops.gitlab.xxx.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
2.嘗試過但不生效的方法
首先,已經確認在gitlab上設置過ssh自己設備的public key。
未生效的方法:(這個方法網上給出的最多,但是對我不適用)
git config --global url."ssh://git@devops.gitlab.xxx.com".insteadof "https://devops.gitlab.xxx.com"
3.生效的方法
將GOPRIVATE改為私有倉庫的域名
go env -w GOPRIVATE="devops.gitlab.xxx.com"
原文鏈接:https://blog.csdn.net/Haikuotiankong11111/article/details/124512192
相關推薦
- 2022-09-18 iOS開發retina屏幕下的點與像素關系詳解_IOS
- 2023-06-04 Pandas通過index選擇并獲取行和列_python
- 2022-09-17 oracle臨時表空間的作用與創建及相關操作詳解_oracle
- 2022-05-18 Qt?關于容器的遍歷迭代器的使用問題小結_C 語言
- 2023-01-20 C#實現自定義動畫鼠標的示例詳解_C#教程
- 2023-06-20 Python實用技巧之臨時文件的妙用_python
- 2022-09-16 Linux?Shell如何用ssh命令統計分布式集群信息詳解_linux shell
- 2022-09-24 ASP.NET?MVC格式化日期_實用技巧
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支