Skip to content

Commit 018d3b2

Browse files
committed
gopls: warn about Go 1.19 and Go 1.20
Update the support table to warn when users install gopls with Go 1.19 or 1.20, or have these older Go versions in their PATH. Clarify current and future support in the README. Fixes golang/go#50825 Updates golang/go#65917 Change-Id: I99de1a7717a8cf99cae1a561ced63e9724dfff66 Reviewed-on: https://go-review.googlesource.com/c/tools/+/588763 Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
1 parent 58cc8a4 commit 018d3b2

File tree

3 files changed

+31
-28
lines changed

3 files changed

+31
-28
lines changed

gopls/README.md

+22-19
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,35 @@ and
7575
### Supported Go versions
7676

7777
`gopls` follows the
78-
[Go Release Policy](https://golang.org/doc/devel/release.html#policy),
79-
meaning that it officially supports the last 2 major Go releases. Per
80-
[issue #39146](https://go.dev/issues/39146), we attempt to maintain best-effort
81-
support for the last 4 major Go releases, but this support extends only to not
82-
breaking the build and avoiding easily fixable regressions.
83-
84-
In the context of this discussion, gopls "supports" a Go version if it supports
85-
being built with that Go version as well as integrating with the `go` command
86-
of that Go version.
87-
88-
The following table shows the final gopls version that supports a given Go
89-
version. Go releases more recent than any in the table can be used with any
90-
version of gopls.
78+
[Go Release Policy](https://golang.org/doc/devel/release.html#policy), meaning
79+
that it officially supports only the two most recent major Go releases. Until
80+
August 2024, the Go team will also maintain best-effort support for the last
81+
4 major Go releases, as described in [issue #39146](https://go.dev/issues/39146).
82+
83+
Starting with the release of Go 1.23.0 and [email protected] in August 2024, the
84+
gopls build will depend on the latest version of Go. However, due to the
85+
[forward compatibility](https://go.dev/blog/toolchain) support added to the
86+
`go` command in Go 1.21, as long as Go 1.21 or later are used to install gopls,
87+
the toolchain upgrade will be handled automatically, just like any other
88+
dependency. Gopls will continue to support integrating with the two most recent
89+
major Go releases of the `go` command, per the Go Release Policy. See
90+
[issue #65917](https://go.dev/issue/65917) for more details.
91+
92+
Maintaining support for legacy versions of Go caused
93+
[significant friction](https://go.dev/issue/50825) for gopls maintainers and
94+
held back other improvements. If you are unable to install a supported version
95+
of Go on your system, you can still install an older version of gopls. The
96+
following table shows the final gopls version that supports a given Go version.
97+
Go releases more recent than those in the table can be used with any version of
98+
gopls.
9199

92100
| Go Version | Final gopls version with support (without warnings) |
93101
| ----------- | --------------------------------------------------- |
94102
| Go 1.12 | [[email protected]](https://github.com/golang/tools/releases/tag/gopls%2Fv0.7.5) |
95103
| Go 1.15 | [[email protected]](https://github.com/golang/tools/releases/tag/gopls%2Fv0.9.5) |
96104
| Go 1.17 | [[email protected]](https://github.com/golang/tools/releases/tag/gopls%2Fv0.11.0) |
97105
| Go 1.18 | [[email protected]](https://github.com/golang/tools/releases/tag/gopls%2Fv0.14.2) |
98-
99-
Our extended support is enforced via [continuous integration with older Go
100-
versions](doc/contributing.md#ci). This legacy Go CI may not block releases:
101-
test failures may be skipped rather than fixed. Furthermore, if a regression in
102-
an older Go version causes irreconcilable CI failures, we may drop support for
103-
that Go version in CI if it is 3 or 4 Go versions old.
106+
| Go 1.20 | [[email protected]](https://github.com/golang/tools/releases/tag/gopls%2Fv0.15.3) |
104107

105108
### Supported build systems
106109

gopls/internal/util/goversion/goversion.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ var Supported = []Support{
4040
{15, "", "v0.9.5"},
4141
{16, "", "v0.11.0"},
4242
{17, "", "v0.11.0"},
43-
{18, "v0.16.0", "v0.14.2"},
43+
{18, "", "v0.14.2"},
44+
{19, "v0.17.0", "v0.15.3"},
45+
{20, "v0.17.0", "v0.15.3"},
4446
}
4547

4648
// OldestSupported is the last X in Go 1.X that this version of gopls

gopls/internal/util/goversion/goversion_test.go

+6-8
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,18 @@ func TestMessage(t *testing.T) {
4040
}
4141
}
4242

43-
tests := []struct {
44-
goVersion int
45-
fromBuild bool
46-
wantContains []string // string fragments that we expect to see
47-
wantIsError bool // an error, not a mere warning
48-
}{
43+
tests := []test{
4944
{-1, false, nil, false},
5045
deprecated(12, "v0.7.5"),
5146
deprecated(13, "v0.9.5"),
5247
deprecated(15, "v0.9.5"),
5348
deprecated(16, "v0.11.0"),
5449
deprecated(17, "v0.11.0"),
55-
{18, false, []string{"Found Go version 1.18", "unsupported by gopls v0.16.0", "upgrade to Go 1.19", "install gopls v0.14.2"}, false},
56-
{18, true, []string{"Gopls was built with Go version 1.18", "unsupported by gopls v0.16.0", "upgrade to Go 1.19", "install gopls v0.14.2"}, false},
50+
deprecated(18, "v0.14.2"),
51+
{19, false, []string{"Found Go version 1.19", "unsupported by gopls v0.17.0", "upgrade to Go 1.21", "install gopls v0.15.3"}, false},
52+
{19, true, []string{"Gopls was built with Go version 1.19", "unsupported by gopls v0.17.0", "upgrade to Go 1.21", "install gopls v0.15.3"}, false},
53+
{20, false, []string{"Found Go version 1.20", "unsupported by gopls v0.17.0", "upgrade to Go 1.21", "install gopls v0.15.3"}, false},
54+
{20, true, []string{"Gopls was built with Go version 1.20", "unsupported by gopls v0.17.0", "upgrade to Go 1.21", "install gopls v0.15.3"}, false},
5755
}
5856

5957
for _, test := range tests {

0 commit comments

Comments
 (0)