Commit 4c97d261 by Leonard Gram Committed by Marcus Efraimsson

Docs: clarified usage of go get and go mod (#17637)

parent c41eba92
...@@ -35,14 +35,17 @@ The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__mo ...@@ -35,14 +35,17 @@ The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__mo
All dependencies are vendored in the `vendor/` directory. All dependencies are vendored in the `vendor/` directory.
_Note:_ Since most developers of Grafana still use the `GOPATH` we need to specify `GO111MODULE=on` to make `go mod` and `got get` work as intended. If you have setup Grafana outside of the `GOPATH` on your machine you can skip `GO111MODULE=on` when running the commands below.
To add or update a new dependency, use the `go get` command: To add or update a new dependency, use the `go get` command:
```bash ```bash
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
# Pick the latest tagged release. # Pick the latest tagged release.
go get example.com/some/module/pkg GO111MODULE=on go get example.com/some/module/pkg
# Pick a specific version. # Pick a specific version.
go get example.com/some/module/pkg@vX.Y.Z GO111MODULE=on go get example.com/some/module/pkg@vX.Y.Z
``` ```
Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory: Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment