Skip to content

x/tools: tests fails when run from a module (or with a go.work file) that uses go1.23+ #70082

Closed
@findleyr

Description

@findleyr

Various x/tools tests fail when run from a module that has go1.23 in its go directive, or (more likely) when using a go.work file that says go1.23, because the tests themselves assume go1.22 semantics.

In particular, tests of the internal/aliases package that assume a default GODEBUG value for gotypesalias are broken.

> cat go.mod
module mod.test

go 1.24

require golang.org/x/tools v0.26.1-0.20241028184645-73d6794ebbd4
> go test golang.org/x/tools/internal/aliases
--- FAIL: TestNewAlias (0.00s)
    --- FAIL: TestNewAlias/#00 (0.00s)
        aliases_test.go:77: Expected A.Type() to not be a types.Alias(). got "p.A"
FAIL
FAIL    golang.org/x/tools/internal/aliases     0.018s
FAIL

I think we should relax these assertions, since they are not valid in all testing scenarios.

CC @timothy-king @adonovan @pjweinb

Metadata

Metadata

Assignees

Labels

ToolsThis label describes issues relating to any tools in the x/tools repository.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions