Skip to content

Commit

Permalink
all: set gotypesalias=1 when using >=1.23 toolchain
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
timothy-king authored and Go LUCI committed Oct 10, 2024
1 parent 915132c commit 4f6e118
Show file tree
Hide file tree
Showing 48 changed files with 288 additions and 68 deletions.
12 changes: 12 additions & 0 deletions cmd/callgraph/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions cmd/callgraph/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

// callgraph: a tool for reporting the call graph of a Go program.
// See Usage for details, or run with -help.

//go:debug gotypesalias=0

package main // import "golang.org/x/tools/cmd/callgraph"

// TODO(adonovan):
Expand Down
2 changes: 0 additions & 2 deletions cmd/deadcode/deadcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions cmd/deadcode/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions cmd/eg/eg.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
// The eg command performs example-based refactoring.
// For documentation, run the command, or see Help in
// golang.org/x/tools/refactor/eg.

//go:debug gotypesalias=0

package main // import "golang.org/x/tools/cmd/eg"

import (
Expand Down
12 changes: 12 additions & 0 deletions cmd/eg/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
2 changes: 0 additions & 2 deletions cmd/godex/godex.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions cmd/godex/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
12 changes: 12 additions & 0 deletions cmd/godoc/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
2 changes: 0 additions & 2 deletions cmd/godoc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
// http://godoc/pkg/compress/zlib)
//

//go:debug gotypesalias=0

package main

import (
Expand Down
2 changes: 0 additions & 2 deletions cmd/goimports/goimports.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions cmd/goimports/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
12 changes: 12 additions & 0 deletions cmd/gomvpkg/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions cmd/gomvpkg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

// The gomvpkg command moves go packages, updating import declarations.
// See the -help message or Usage constant for details.

//go:debug gotypesalias=0

package main

import (
Expand Down
3 changes: 0 additions & 3 deletions cmd/gotype/gotype.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ To verify the output of a pipe:
echo "package foo" | gotype
*/

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions cmd/gotype/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
12 changes: 12 additions & 0 deletions cmd/ssadump/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions cmd/ssadump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// license that can be found in the LICENSE file.

// ssadump: a tool for displaying and interpreting the SSA form of Go programs.

//go:debug gotypesalias=0

package main // import "golang.org/x/tools/cmd/ssadump"

import (
Expand Down
12 changes: 12 additions & 0 deletions cmd/stringer/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions cmd/stringer/stringer.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@
// PillAspirin // Aspirin
//
// to suppress it in the output.

//go:debug gotypesalias=0

package main // import "golang.org/x/tools/cmd/stringer"

import (
Expand Down
12 changes: 12 additions & 0 deletions go/analysis/passes/defers/cmd/defers/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions go/analysis/passes/defers/cmd/defers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// license that can be found in the LICENSE file.

// The defers command runs the defers analyzer.

//go:debug gotypesalias=0

package main

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions go/analysis/passes/fieldalignment/cmd/fieldalignment/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions go/analysis/passes/findcall/cmd/findcall/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions go/analysis/passes/findcall/cmd/findcall/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// license that can be found in the LICENSE file.

// The findcall command runs the findcall analyzer.

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions go/analysis/passes/httpmux/cmd/httpmux/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions go/analysis/passes/httpmux/cmd/httpmux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// license that can be found in the LICENSE file.

// The httpmux command runs the httpmux analyzer.

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions go/analysis/passes/ifaceassert/cmd/ifaceassert/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions go/analysis/passes/ifaceassert/cmd/ifaceassert/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// license that can be found in the LICENSE file.

// The ifaceassert command runs the ifaceassert analyzer.

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions go/analysis/passes/lostcancel/cmd/lostcancel/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions go/analysis/passes/lostcancel/cmd/lostcancel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

// The lostcancel command applies the golang.org/x/tools/go/analysis/passes/lostcancel
// analysis to the specified packages of Go source code.

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions go/analysis/passes/nilness/cmd/nilness/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
3 changes: 0 additions & 3 deletions go/analysis/passes/nilness/cmd/nilness/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

// The nilness command applies the golang.org/x/tools/go/analysis/passes/nilness
// analysis to the specified packages of Go source code.

//go:debug gotypesalias=0

package main

import (
Expand Down
12 changes: 12 additions & 0 deletions go/analysis/passes/shadow/cmd/shadow/gotypesalias.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.23

//go:debug gotypesalias=1

package main

// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).
Loading

0 comments on commit 4f6e118

Please sign in to comment.