-
Book Overview & Buying
-
Table Of Contents
Go Recipes for Developers
By :
Sometimes, you need a specific version of a third-party package because of API incompatibilities or a particular behavior you depend on.
$ go get modernc.org/[email protected]
$ go get gopkg.in/yaml.v3
Alternatively, use this:
$ go get github.com/ory/dockertest/v3
$ go get modernc.org/sqlite
devel branch, if there is one:$ go get modernc.org/sqlite@devel
$ go get modernc.org/sqlite@a8c3eea199bc8fdc39391d5d261eaa3577566050
As you can see, you can get a specific revision of a module using the @revision convention:
$ go get modernc.org/[email protected]
The revision part of the URL is evaluated by the version control system, which, in this case, is git, so any valid git revision syntax can be used.
Tip:
You can find which revision control systems are supported by checking out the src/cmd/go/alldocs.go file under your Go installation.
That also means you can use branches:
$ go get modernc.org/sqlite@master
Tip
The https://gopkg.in service translates version numbers to URLs compatible with the Go build system. Refer to the instructions on that website on how to use it.