go私有仓库备忘

下文以 coding.net 的仓库为例

1. 设置必要的go env

go env -w GOPRIVATE="e.coding.net"
go env -w GONOPROXY="e.coding.net"
go env -w GONOSUMDB="e.coding.net"

2. git url规则配置

经过多次踩坑摸索,这个配置在Linux和Windows环境下略有不同

# Linux
git config --global url."git@e.coding.net:".insteadOf "https://e.coding.net"

# Windows
git config --global url."ssh://e.coding.net:".instanceOf "https://e.coding.net"

至此便可使用自己的私有仓库作为go module了

标签: none


Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /data/apps/skidu/var/Typecho/Request.php on line 310

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /data/apps/skidu/var/Typecho/Db/Adapter/Pdo/Mysql.php on line 65

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /data/apps/skidu/var/Typecho/Db/Adapter/Pdo/Mysql.php on line 65

评论已关闭

  • 上一篇: 观赛
  • 下一篇: 没有了