From 7588ddd3e9b7a41f0e80884f8ab29d136b85ede9 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 16 Jul 2021 14:16:46 -0400 Subject: [PATCH] _content/ref/mod: mention other Go 1.17 behaviors that depend on the go version Updates golang/go#36876 Updates golang/go#42970 Updates golang/go#45965 Change-Id: I542e9ece986806f9b4a062f242387b1ca47f5814 Reviewed-on: https://go-review.googlesource.com/c/website/+/335050 Trust: Bryan C. Mills Run-TryBot: Bryan C. Mills TryBot-Result: Go Bot Reviewed-by: Jay Conrod --- _content/ref/mod.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/_content/ref/mod.md b/_content/ref/mod.md index 914b8c16a3..466a564283 100644 --- a/_content/ref/mod.md +++ b/_content/ref/mod.md @@ -564,13 +564,22 @@ specified by the `go` directive. This has the following effects: [`go mod vendor`](#go-mod-vendor) since modules were introduced. In lower versions, `all` also includes tests of packages imported by packages in the main module, tests of those packages, and so on. -* At `go 1.17` or higher, the `go.mod` file includes an explicit [`require` - directive](#go-mod-file-require) for each module that provides any package - transitively imported by a package or test in the main module. (At `go 1.16` - and lower, an [indirect dependency](#glos-direct-dependency) is included only - if [minimal version selection](#minimal-version-selection) would otherwise - select a different version.) This extra information enables [lazy - loading](#lazy-loading) and [module graph pruning](#graph-pruning). +* At `go 1.17` or higher: + * The `go.mod` file includes an explicit [`require` + directive](#go-mod-file-require) for each module that provides any package + transitively imported by a package or test in the main module. (At `go + 1.16` and lower, an [indirect dependency](#glos-direct-dependency) is + included only if [minimal version selection](#minimal-version-selection) + would otherwise select a different version.) This extra information enables + [lazy loading](#lazy-loading) and [module graph pruning](#graph-pruning). + * Because there may be many more `// indirect` dependencies than in previous + `go` versions, indirect dependencies are recorded in a separate block + within the `go.mod` file. + * `go mod vendor` omits `go.mod` and `go.sum` files for vendored + dependencies. (That allows invocations of the `go` command within + subdirectories of `vendor` to identify the correct main module.) + * `go mod vendor` records the `go` version from each dependency's `go.mod` + file in `vendor/modules.txt`. A `go.mod` file may contain at most one `go` directive. Most commands will add a `go` directive with the current Go version if one is not present.