Skip to content

Commit 4f6e118

Browse files
timothy-kingGo LUCI
authored and
Go LUCI
committed
all: set gotypesalias=1 when using >=1.23 toolchain
Set gotypesalias=1 when using >=1.23 toolchain on all of the main packages in x/tools that use go/types. Does not include packages that are ignored due to build tags. This effectively upgrades commit https://go.dev/cl/617095. For golang/go#69772 Change-Id: I434c280b928ad21e1fd9c7f880e1324c14741dc3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/619395 Reviewed-by: Robert Findley <[email protected]> Commit-Queue: Tim King <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 915132c commit 4f6e118

File tree

48 files changed

+288
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+288
-68
lines changed

cmd/callgraph/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/callgraph/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
// callgraph: a tool for reporting the call graph of a Go program.
66
// See Usage for details, or run with -help.
7-
8-
//go:debug gotypesalias=0
9-
107
package main // import "golang.org/x/tools/cmd/callgraph"
118

129
// TODO(adonovan):

cmd/deadcode/deadcode.go

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:debug gotypesalias=0
6-
75
package main
86

97
import (

cmd/deadcode/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/eg/eg.go

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// The eg command performs example-based refactoring.
66
// For documentation, run the command, or see Help in
77
// golang.org/x/tools/refactor/eg.
8-
9-
//go:debug gotypesalias=0
10-
118
package main // import "golang.org/x/tools/cmd/eg"
129

1310
import (

cmd/eg/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/godex/godex.go

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:debug gotypesalias=0
6-
75
package main
86

97
import (

cmd/godex/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/godoc/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/godoc/main.go

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
// http://godoc/pkg/compress/zlib)
1515
//
1616

17-
//go:debug gotypesalias=0
18-
1917
package main
2018

2119
import (

cmd/goimports/goimports.go

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:debug gotypesalias=0
6-
75
package main
86

97
import (

cmd/goimports/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/gomvpkg/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/gomvpkg/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
// The gomvpkg command moves go packages, updating import declarations.
66
// See the -help message or Usage constant for details.
7-
8-
//go:debug gotypesalias=0
9-
107
package main
118

129
import (

cmd/gotype/gotype.go

-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ To verify the output of a pipe:
8585
8686
echo "package foo" | gotype
8787
*/
88-
89-
//go:debug gotypesalias=0
90-
9188
package main
9289

9390
import (

cmd/gotype/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/ssadump/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/ssadump/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
// ssadump: a tool for displaying and interpreting the SSA form of Go programs.
6-
7-
//go:debug gotypesalias=0
8-
96
package main // import "golang.org/x/tools/cmd/ssadump"
107

118
import (

cmd/stringer/gotypesalias.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/stringer/stringer.go

-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@
7070
// PillAspirin // Aspirin
7171
//
7272
// to suppress it in the output.
73-
74-
//go:debug gotypesalias=0
75-
7673
package main // import "golang.org/x/tools/cmd/stringer"
7774

7875
import (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

go/analysis/passes/defers/cmd/defers/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
// The defers command runs the defers analyzer.
6-
7-
//go:debug gotypesalias=0
8-
96
package main
107

118
import (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

go/analysis/passes/fieldalignment/cmd/fieldalignment/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Copyright 2021 The Go Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
4-
5-
//go:debug gotypesalias=0
6-
74
package main
85

96
import (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

go/analysis/passes/findcall/cmd/findcall/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
// The findcall command runs the findcall analyzer.
6-
7-
//go:debug gotypesalias=0
8-
96
package main
107

118
import (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

go/analysis/passes/httpmux/cmd/httpmux/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
// The httpmux command runs the httpmux analyzer.
6-
7-
//go:debug gotypesalias=0
8-
96
package main
107

118
import (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

go/analysis/passes/ifaceassert/cmd/ifaceassert/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
// The ifaceassert command runs the ifaceassert analyzer.
6-
7-
//go:debug gotypesalias=0
8-
96
package main
107

118
import (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

go/analysis/passes/lostcancel/cmd/lostcancel/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
// The lostcancel command applies the golang.org/x/tools/go/analysis/passes/lostcancel
66
// analysis to the specified packages of Go source code.
7-
8-
//go:debug gotypesalias=0
9-
107
package main
118

129
import (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

go/analysis/passes/nilness/cmd/nilness/main.go

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
// The nilness command applies the golang.org/x/tools/go/analysis/passes/nilness
66
// analysis to the specified packages of Go source code.
7-
8-
//go:debug gotypesalias=0
9-
107
package main
118

129
import (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2024 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

0 commit comments

Comments
 (0)