From: Ian Lance Taylor Date: Wed, 12 Jun 2019 14:01:04 +0000 (-0700) Subject: cmd/go: add more docs for go directive in go.mod file X-Git-Tag: go1.13beta1~34 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b3399ac5d19c896452548ca8e99176bcdab78781;p=gostls13.git cmd/go: add more docs for go directive in go.mod file Updates #30791 Change-Id: I67efd7fd3b3a550428b16518bb27a3d81c178d28 Reviewed-on: https://go-review.googlesource.com/c/go/+/181840 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 d2ce578564..40cbaa2331 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1806,6 +1806,13 @@ // including go build, go get, go install, go list, go test, go mod graph, // go mod tidy, and go mod why. // +// The expected language version, set by the go directive, determines +// which language features are available when compiling the module. +// Language features available in that version will be available for use. +// Language features removed in earlier versions, or added in later versions, +// will not be available. Note that the language version does not affect +// build tags, which are determined by the Go release being used. +// // // GOPATH environment variable // diff --git a/src/cmd/go/internal/modload/help.go b/src/cmd/go/internal/modload/help.go index 9ce8dfb33b..788544c2c8 100644 --- a/src/cmd/go/internal/modload/help.go +++ b/src/cmd/go/internal/modload/help.go @@ -464,5 +464,12 @@ Because the module graph defines the meaning of import statements, any commands that load packages also use and therefore update go.mod, including go build, go get, go install, go list, go test, go mod graph, go mod tidy, and go mod why. + +The expected language version, set by the go directive, determines +which language features are available when compiling the module. +Language features available in that version will be available for use. +Language features removed in earlier versions, or added in later versions, +will not be available. Note that the language version does not affect +build tags, which are determined by the Go release being used. `, }