aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/plugin.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2023-03-13 21:06:49 -0400
committerGopher Robot <gobot@golang.org>2023-04-14 16:08:31 +0000
commit804d786a30c664df63ef1e0c95d44772063afae1 (patch)
tree25514a360478e8361904fbfec0c41f508bfd29df /src/runtime/plugin.go
parent8854be4180fe1fb59c56c645ef8978788eb40170 (diff)
downloadgo-804d786a30c664df63ef1e0c95d44772063afae1.tar.xz
go/types, cmd/compile/internal/types2: use per-file Go version
For #57001, compilers and others tools will need to understand that a different Go version can be used in different files in a program, according to the //go:build lines in those files. Update go/types and cmd/compile/internal/types2 to track and use per-file Go versions. The two must be updated together because of the files in go/types that are generated from files in types2. The effect of the //go:build go1.N line depends on the Go version declared in the 'go 1.M' line in go.mod. If N > M, the file gets go1.N semantics when built with a Go 1.N or later toolchain (when built with an earlier toolchain the //go:build line will keep the file from being built at all). If N < M, then in general we want the file to get go1.N semantics as well, meaning later features are disabled. However, older Go 1.M did not apply this kind of downgrade, so for compatibility, N < M only has an effect when M >= 21, meaning when using semantics from Go 1.21 or later. For #59033. Change-Id: I93cf07e6c687d37bd37a9461dc60cc032bafd01d Reviewed-on: https://go-review.googlesource.com/c/go/+/476278 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/plugin.go')
0 files changed, 0 insertions, 0 deletions