]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: document the go statement in a go.mod file
authorIan Lance Taylor <iant@golang.org>
Fri, 2 Nov 2018 23:29:04 +0000 (16:29 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 8 Nov 2018 01:56:03 +0000 (01:56 +0000)
Change-Id: I8db276ec371de56871ce3250f27de1d1dee4b473
Reviewed-on: https://go-review.googlesource.com/c/147279
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/modload/help.go

index 41f9f84046cf3f1a680620bcb5b9d186eaac7cf9..27dbdd94f53e5c2077b0463be437130a9ba105ac 100644 (file)
 // 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:
index ddc2a7632ff16069ec39e3f613a7bb67df0fc319..d9c8ae40d88f39a80109a31f3116210d6e6b9127 100644 (file)
@@ -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: