-2

I am new for Go, and I am working on the project which need importing internal library. I can use go get to import it, and it works very well. So I noticed that running go get, it will import the master branch. However, I have a special case, that I need to import a dev branch instead of master branch. After doing some research, I tried go get libraryUrl@branchName, and it does not work for me. Any idea how to do it? Here is my go mod info

module projectName
go 1.15
require(
     github.com/satori/go.uuid v1.2.0
     internal libraryURL v0.01
)

Thank you for the help. And let me know if you need more info.

LiLian
  • 289
  • 2
  • 14

1 Answers1

-2

Thank to @blackgreen, who give me a link regarding this problem. I post here for someone who met the same problem as me. The conclusion is if go get libraryUrl@branchName doesn't work for you, set up the go env -w GO111MODULE=on. Then it shall work.

LiLian
  • 289
  • 2
  • 14