Skip to content

Commit 3e80024

Browse files
committed
_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 <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
1 parent 5d33635 commit 3e80024

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

_content/ref/mod.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,22 @@ specified by the `go` directive. This has the following effects:
564564
[`go mod vendor`](#go-mod-vendor) since modules were introduced. In lower
565565
versions, `all` also includes tests of packages imported by packages in
566566
the main module, tests of those packages, and so on.
567-
* At `go 1.17` or higher, the `go.mod` file includes an explicit [`require`
568-
directive](#go-mod-file-require) for each module that provides any package
569-
transitively imported by a package or test in the main module. (At `go 1.16`
570-
and lower, an [indirect dependency](#glos-direct-dependency) is included only
571-
if [minimal version selection](#minimal-version-selection) would otherwise
572-
select a different version.) This extra information enables [lazy
573-
loading](#lazy-loading) and [module graph pruning](#graph-pruning).
567+
* At `go 1.17` or higher:
568+
* The `go.mod` file includes an explicit [`require`
569+
directive](#go-mod-file-require) for each module that provides any package
570+
transitively imported by a package or test in the main module. (At `go
571+
1.16` and lower, an [indirect dependency](#glos-direct-dependency) is
572+
included only if [minimal version selection](#minimal-version-selection)
573+
would otherwise select a different version.) This extra information enables
574+
[lazy loading](#lazy-loading) and [module graph pruning](#graph-pruning).
575+
* Because there may be many more `// indirect` dependencies than in previous
576+
`go` versions, indirect dependencies are recorded in a separate block
577+
within the `go.mod` file.
578+
* `go mod vendor` omits `go.mod` and `go.sum` files for vendored
579+
dependencies. (That allows invocations of the `go` command within
580+
subdirectories of `vendor` to identify the correct main module.)
581+
* `go mod vendor` records the `go` version from each dependency's `go.mod`
582+
file in `vendor/modules.txt`.
574583

575584
A `go.mod` file may contain at most one `go` directive. Most commands will add a
576585
`go` directive with the current Go version if one is not present.

0 commit comments

Comments
 (0)