]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/testdir: add a -gomodversion flag
authorTim King <taking@google.com>
Fri, 9 Aug 2024 20:32:12 +0000 (13:32 -0700)
committerTim King <taking@google.com>
Tue, 20 Aug 2024 17:17:59 +0000 (17:17 +0000)
commitab4182251ba57b0d1fe9abbfd604861a6ae75463
tree0180ab3360641af6e137ab72504a845b326bcc14
parentb292799ddd0e81ef6ffbbe5c7972786673d122f9
cmd/internal/testdir: add a -gomodversion flag

Adds a -gomodversion flag to testdir. This sets the go version
in generated go.mod files. This is just runindir tests at the moment.
This is a building block so that tests can be written for exported
type parameterized aliases (like reproducing #68526).

This also adds a test that uses this feature. A type parameterized
alias is used so aliastypeparams and gotypesalias must be enabled.
gotypesalias is enabled by the go module version. The alias is not
exported and will not appear in exportdata. The test shows the
package containing the alias can be imported. This encapsulates
the level of support of type parameterized aliases in 1.23.

Updates #68526
Updates #68778

Change-Id: I8e20df6baa178e1d427d0fff627a16714d9c3b18
Reviewed-on: https://go-review.googlesource.com/c/go/+/604102
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/internal/testdir/testdir_test.go
test/fixedbugs/issue68526.dir/a/a.go [new file with mode: 0644]
test/fixedbugs/issue68526.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue68526.go [new file with mode: 0644]