diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4eceade1a..1e5dae17d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,3 +51,31 @@ All our issues are regularly tagged so that you can also filter down the issues * If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment, or you can ask for a review on IRC channel [#prometheus](https://webchat.freenode.net/?channels=#prometheus) on irc.freenode.net (for the easiest start, [join via Riot](https://riot.im/app/#/room/#prometheus:matrix.org)). * Add tests relevant to the fixed bug or new feature. + +## Dependency management + +The Prometheus project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. This requires a working Go environment with version 1.11 or greater installed. + +All dependencies are vendored in the `vendor/` directory. + +To add or update a new dependency, use the `go get` command: + +```bash +# Pick the latest tagged release. +go get example.com/some/module/pkg + +# Pick a specific version. +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: + + +```bash +# The GO111MODULE variable can be omitted when the code isn't located in GOPATH. +GO111MODULE=on go mod tidy + +GO111MODULE=on go mod vendor +``` + +You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request. diff --git a/README.md b/README.md index 64ef62a0d..d43c23d64 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Prometheus will now be reachable at http://localhost:9090/. ### Building from source To build Prometheus from the source code yourself you need to have a working -Go environment with [version 1.10 or greater installed](http://golang.org/doc/install). +Go environment with [version 1.11 or greater installed](http://golang.org/doc/install). You can directly use the `go` tool to download and install the `prometheus` and `promtool` binaries into your `GOPATH`: diff --git a/web/ui/doc.go b/web/ui/doc.go index b4ffb0552..455ac2e9c 100644 --- a/web/ui/doc.go +++ b/web/ui/doc.go @@ -15,7 +15,7 @@ package ui import ( - // The blank import is to make govendor happy. + // The blank import is to make Go modules happy. _ "github.com/shurcooL/vfsgen" )