Skip to content

Commit

Permalink
_content/ref/mod: mention other Go 1.17 behaviors that depend on the …
Browse files Browse the repository at this point in the history
…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 <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
  • Loading branch information
Bryan C. Mills committed Jul 16, 2021
1 parent fa093af commit 7588ddd
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions _content/ref/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7588ddd

Please sign in to comment.