From 1aea2c71f3fb6ce259dc1c38bce551fb504fca8c Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Wed, 14 Aug 2019 15:36:24 +0200 Subject: [PATCH 1/2] README.md: Update Vendored Dependencies section --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 71d5c6b9b7..66c27d158e 100644 --- a/README.md +++ b/README.md @@ -189,12 +189,14 @@ $ git clone git@github.com:nirname/swarm.git $GOPATH/src/github.com/ethersphere/ ### Vendored Dependencies -All dependencies are tracked in the `vendor` directory. We use `go mod` to manage depenedencies, except for `go mod vendor` command. Vendoring is done by Makefile rule `make vendor` which uses `go mod vendor` and additionally copies cgo dependencies into `vendor` directory from go modules cache. +All dependencies are tracked in the `vendor` directory. We use `go mod` to manage dependencies, except for `go mod vendor` command. Vendoring is done by Makefile rule `make vendor` which uses `go mod vendor` and additionally copies cgo dependencies into `vendor` directory from go modules cache. -If you want to add a new dependency, run `GO111MODULE=on go get `, vendor it `make vednor`, then commit the result. +If you want to add a new dependency, run `GO111MODULE=on go get `, vendor it `make vendor`, then commit the result. If you want to update all dependencies to their latest upstream version, run `GO111MODULE=on go get -u all` and vendor them with `make vendor`. +By default, `go` tool will use dependencies defined in `go.mod` file from modules cache. In order to import code from `vendor` directory, an additional flag `-mod=vendor` must be provided when calling `go run`, `go test`, `go build` and `go install`. If `vendor` directory is in sync with `go.mod` file by updating it with `make vendor`, there should be no difference to use the flag or not. All Swarm build tools are using code only from the `vendor` directory and it is encouraged to do the same in the development process, as well. + ### Testing From a60acf6e5ee2aa9decebaeb22ee8b95901517559 Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Wed, 14 Aug 2019 18:09:15 +0200 Subject: [PATCH 2/2] README.md: remove redundant information from Vendored Dependencies section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 66c27d158e..324ed733b5 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ $ git clone git@github.com:nirname/swarm.git $GOPATH/src/github.com/ethersphere/ ### Vendored Dependencies -All dependencies are tracked in the `vendor` directory. We use `go mod` to manage dependencies, except for `go mod vendor` command. Vendoring is done by Makefile rule `make vendor` which uses `go mod vendor` and additionally copies cgo dependencies into `vendor` directory from go modules cache. +Vendoring is done by Makefile rule `make vendor` which uses `go mod vendor` and additionally copies cgo dependencies into `vendor` directory from go modules cache. If you want to add a new dependency, run `GO111MODULE=on go get `, vendor it `make vendor`, then commit the result.