Skip to content
Snippets Groups Projects
  • Tim King's avatar
    ab418225
    cmd/internal/testdir: add a -gomodversion flag · ab418225
    Tim King authored
    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: default avatarAustin Clements <austin@google.com>
    ab418225
    History
    cmd/internal/testdir: add a -gomodversion flag
    Tim King authored
    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: default avatarAustin Clements <austin@google.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.