golang專案引用GitHub私有倉庫module

tonglin0325發表於2024-10-19

1.建立go module專案

golang專案引用GitHub私有倉庫module

module的名字假設為go-test

golang專案引用GitHub私有倉庫module

module專案建立成功後,將go.mod檔案中的 module "go-test" 修改成

module "github.com/tonglin0325/go-test"

避免引用的時候go get的時候報錯,如下

go get github.com/tonglin0325/go-test@latest
go: github.com/tonglin0325/go-test@latest (v1.0.0) requires github.com/tonglin0325/go-test@v1.0.0: parsing go.mod:
	module declares its path as: go-test
	        but was required as: github.com/tonglin0325/go-test

相關文章