Home >Backend Development >Golang >How Can I Use `go get` to Retrieve Specific Git Tags from GitHub for Go Dependencies?
Github Go Dependency Management: Utilizing Specific Tags with "go get"
The "go get" command is a convenient tool for acquiring Go packages from the Github repository. However, when attempting to target a specific tag on the repository, challenges can arise.
Issue:
In the case of the InfluxDB database (version v0.8.8), the standard "go get github.com/influxdb/influxdb" command retrieves the master branch. To access the v0.8.8 tag, alternative approaches have been attempted without success.
Solution:
Unfortunately, using the "go get" tool alone does not allow for the retrieval of specific tags. Third-party Go package management tools or the creation of customized forks of the desired packages are necessary to achieve this fine-grained dependency management.
Recent discussions with a Google employee acknowledge this issue and suggest that official tooling may resolve it in the future.
Alternative Resources:
Updates in Go 1.6:
Go 1.6 has introduced vendoring, making it easier to utilize specific tags/versions of packages using third-party tools. However, "go get" still lacks the functionality to fetch specific tags.
Modules in Go 1.11:
Go 1.11 introduces experimental features called "modules" to improve dependency management, with plans for stabilization in Go 1.12. [Information about modules in Go 1.11](https://blog.golang.org/go1.11-modules) provides further details.
The above is the detailed content of How Can I Use `go get` to Retrieve Specific Git Tags from GitHub for Go Dependencies?. For more information, please follow other related articles on the PHP Chinese website!