From: Ian Lance Taylor Date: Fri, 2 Nov 2018 23:29:04 +0000 (-0700) Subject: cmd/go: document the go statement in a go.mod file X-Git-Tag: go1.12beta1~454 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=67018e9b684d1a9686a37053307476cd32358c17;p=gostls13.git cmd/go: document the go statement in a go.mod file Change-Id: I8db276ec371de56871ce3250f27de1d1dee4b473 Reviewed-on: https://go-review.googlesource.com/c/147279 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 41f9f84046..27dbdd94f5 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1604,17 +1604,20 @@ // verb followed by arguments. For example: // // module my/thing +// go 1.12 // require other/thing v1.0.2 // require new/thing/v2 v2.3.4 // exclude old/thing v1.2.3 // replace bad/thing v1.4.5 => good/thing v1.4.5 // -// The verbs are module, to define the module path; require, to require -// a particular module at a given version or later; exclude, to exclude -// a particular module version from use; and replace, to replace a module -// version with a different module version. Exclude and replace apply only -// in the main module's go.mod and are ignored in dependencies. -// See https://research.swtch.com/vgo-mvs for details. +// The verbs are +// module, to define the module path; +// go, to set the expected language version; +// require, to require a particular module at a given version or later; +// exclude, to exclude a particular module version from use; and +// replace, to replace a module version with a different module version. +// Exclude and replace apply only in the main module's go.mod and are ignored +// in dependencies. See https://research.swtch.com/vgo-mvs for details. // // The leading verb can be factored out of adjacent lines to create a block, // like in Go imports: diff --git a/src/cmd/go/internal/modload/help.go b/src/cmd/go/internal/modload/help.go index ddc2a7632f..d9c8ae40d8 100644 --- a/src/cmd/go/internal/modload/help.go +++ b/src/cmd/go/internal/modload/help.go @@ -393,17 +393,20 @@ no /* */ comments. Each line holds a single directive, made up of a verb followed by arguments. For example: module my/thing + go 1.12 require other/thing v1.0.2 require new/thing/v2 v2.3.4 exclude old/thing v1.2.3 replace bad/thing v1.4.5 => good/thing v1.4.5 -The verbs are module, to define the module path; require, to require -a particular module at a given version or later; exclude, to exclude -a particular module version from use; and replace, to replace a module -version with a different module version. Exclude and replace apply only -in the main module's go.mod and are ignored in dependencies. -See https://research.swtch.com/vgo-mvs for details. +The verbs are + module, to define the module path; + go, to set the expected language version; + require, to require a particular module at a given version or later; + exclude, to exclude a particular module version from use; and + replace, to replace a module version with a different module version. +Exclude and replace apply only in the main module's go.mod and are ignored +in dependencies. See https://research.swtch.com/vgo-mvs for details. The leading verb can be factored out of adjacent lines to create a block, like in Go imports: