aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Findley <rfindley@google.com>2023-07-19 11:21:00 -0400
committerRobert Findley <rfindley@google.com>2023-07-24 02:02:15 +0000
commit8472fcb62d31662cb2d56722aecfaca7b968db57 (patch)
tree4b52e5bd822a714547057a7ecb67cd501bef3ae4
parentb36e5555dd616c627a0a4234ff67d8bf83f741cd (diff)
downloadgo-8472fcb62d31662cb2d56722aecfaca7b968db57.tar.gz
go-8472fcb62d31662cb2d56722aecfaca7b968db57.zip
[release-branch.go1.21] go/types, types2: update documentation for GoVersion
Update the documentation for Config.GoVersion to reflect the changes made for #61175. Change-Id: I9f3fbcf8ee88e52d6a5e7cf80dad3d2fb5313893 Reviewed-on: https://go-review.googlesource.com/c/go/+/511096 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> (cherry picked from commit 12f3d6858e73abf6bc78c8fe5ce5d0220ffaeb5c) Reviewed-on: https://go-review.googlesource.com/c/go/+/511699 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
-rw-r--r--src/cmd/compile/internal/types2/api.go10
-rw-r--r--src/go/types/api.go10
2 files changed, 10 insertions, 10 deletions
diff --git a/src/cmd/compile/internal/types2/api.go b/src/cmd/compile/internal/types2/api.go
index 63ef31ba84..d0c0cdb8f9 100644
--- a/src/cmd/compile/internal/types2/api.go
+++ b/src/cmd/compile/internal/types2/api.go
@@ -110,11 +110,11 @@ type Config struct {
// type checker will initialize this field with a newly created context.
Context *Context
- // GoVersion describes the accepted Go language version. The string
- // must follow the format "go%d.%d" (e.g. "go1.12") or ist must be
- // empty; an empty string disables Go language version checks.
- // If the format is invalid, invoking the type checker will cause a
- // panic.
+ // GoVersion describes the accepted Go language version. The string must
+ // start with a prefix of the form "go%d.%d" (e.g. "go1.20", "go1.21rc1", or
+ // "go1.21.0") or it must be empty; an empty string disables Go language
+ // version checks. If the format is invalid, invoking the type checker will
+ // result in an error.
GoVersion string
// If IgnoreFuncBodies is set, function bodies are not
diff --git a/src/go/types/api.go b/src/go/types/api.go
index 61d313c0e1..ad4c1a2e9f 100644
--- a/src/go/types/api.go
+++ b/src/go/types/api.go
@@ -114,11 +114,11 @@ type Config struct {
// type checker will initialize this field with a newly created context.
Context *Context
- // GoVersion describes the accepted Go language version. The string
- // must follow the format "go%d.%d" (e.g. "go1.12") or it must be
- // empty; an empty string disables Go language version checks.
- // If the format is invalid, invoking the type checker will cause a
- // panic.
+ // GoVersion describes the accepted Go language version. The string must
+ // start with a prefix of the form "go%d.%d" (e.g. "go1.20", "go1.21rc1", or
+ // "go1.21.0") or it must be empty; an empty string disables Go language
+ // version checks. If the format is invalid, invoking the type checker will
+ // result in an error.
GoVersion string
// If IgnoreFuncBodies is set, function bodies are not