From 947795d5f302735ae1c58e2b6b0c1a1ac9a1f56b Mon Sep 17 00:00:00 2001 From: Christian Glombek Date: Tue, 24 Dec 2019 13:16:35 +0100 Subject: [PATCH] docs: Update dependencies.md --- docs/dev/dependencies.md | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/docs/dev/dependencies.md b/docs/dev/dependencies.md index 68fe7433f7..311a3504cb 100644 --- a/docs/dev/dependencies.md +++ b/docs/dev/dependencies.md @@ -16,33 +16,15 @@ If you need support for [libvirt destroy](libvirt/README.md#cleanup), you should We follow a hard flattening approach; i.e. direct and inherited dependencies are installed in the base `vendor/`. -Dependencies are managed with [dep](https://golang.github.io/dep/) but committed directly to the repository. If you don't have dep, install the latest release from [Installation](https://golang.github.io/dep/docs/installation.html) link. +Dependencies are managed with [Go Modules](https://github.com/golang/go/wiki/Modules) but committed directly to the repository. -We require at least following version for dep: +We require at least Go 1.13. -```console -$ dep version -dep: - version : v0.5.0 - build date : 2018-07-26 - git hash : 224a564 - go version : go1.10.3 -``` +- Add or update a dependency with `go get @`. +- If you want to use a fork of a project or ensure that a dependency is not updated even when another dependency requires a newer version of it, manually add a [replace directive in the go.mod file](https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive). +- Run `go mod tidy` to tidy `go.mod` and update `go.sum`, then commit the changes. +- Run `go mod vendor` to re-vendor and then commit updated vendored code separately. -To add a new dependency: - -- Edit the `Gopkg.toml` file to add your dependency. -- Ensure you add a `version` field for the tag or the `revision` field for commit id you want to pin to. -- Revendor the dependencies: - -```sh -dep ensure -``` - -This [guide](https://golang.github.io/dep/docs/daily-dep.html) is a great source to learn more about using `dep`. +This [guide](https://github.com/golang/go/wiki/Modules#how-to-use-modules) is a great source to learn more about using `go mod`. For the sake of your fellow reviewers, commit vendored code separately from any other changes. - -## Tests - -See [tests/README.md](../../tests/README.md).