How to checkout a release with go get?
I have been trying to install a module using
go get github.com/xxx/xxx. It used to get installed easily previously, but the maintainers release a new release and it’s not working for me anymore. I am looking to know if there is any way I can get the previous release to install? By default it is installing the master branch. Is there any flag where I can put the branch info like
go get github.com/xxx/xxx --branch=xxx?
- Structuring Go subpackages for teams
- How to get another branch instead of default branch with go get
- Go: how to add git revision to binaries built?
- Dockerhub automated builds with multiple private repos
- go install: no install location for directory
- How can I get remote package for Go?
2 Solutions collect form web for “How to checkout a release with go get?”
No, you’ll need to use an external dependency management tool that can handle branch and version freezes. Then you use it instead of calling
go get directly – this changes from tool to tool – and you can freeze versions. A few popular tools:
Godep (I personally use it): https://github.com/tools/godep
Some libraries use
gopkg.inwhich embeds vesions into the import urls. http://labix.org/gopkg.in This does allow to use go-get directly, but it depends on whether the libraries are released via gopkg
You can fork the library and decide if you want to pull new versions to your fork. And roll back if the new version break you application.