@@ -564,13 +564,22 @@ specified by the `go` directive. This has the following effects:
564
564
[ ` go mod vendor ` ] ( #go-mod-vendor ) since modules were introduced. In lower
565
565
versions, ` all ` also includes tests of packages imported by packages in
566
566
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 ` .
574
583
575
584
A ` go.mod ` file may contain at most one ` go ` directive. Most commands will add a
576
585
` go ` directive with the current Go version if one is not present.
0 commit comments