1.建立go module專案
module的名字假設為go-test
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