Skip to content

Commit

Permalink
all: set gotypesalias=0 explicitly
Browse files Browse the repository at this point in the history
Set GODEBUG variable gotypesalias to off in all main packages
in x/tools that use go/types.

This is a no-op as the x/tools go.mod is uses version 1.22,
which disables gotypesalias in main packages and tests by default.

Change-Id: I1593cd63ec018e230e126d990530bd59fb9a96cf
Reviewed-on: https://go-review.googlesource.com/c/tools/+/617095
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Tim King <taking@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
  • Loading branch information
timothy-king authored and Go LUCI committed Oct 2, 2024
1 parent ce2a33e commit a24facf
Show file tree
Hide file tree
Showing 25 changed files with 71 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/bundle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
// Update all bundles in the standard library:
//
// go generate -run bundle std

//go:debug gotypesalias=0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions cmd/callgraph/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

// 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: 2 additions & 0 deletions cmd/deadcode/deadcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// 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
3 changes: 3 additions & 0 deletions cmd/eg/eg.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// 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
2 changes: 2 additions & 0 deletions cmd/godex/godex.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// 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
2 changes: 2 additions & 0 deletions cmd/godoc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// http://godoc/pkg/compress/zlib)
//

//go:debug gotypesalias=0

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/goimports/goimports.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// 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
3 changes: 3 additions & 0 deletions cmd/gomvpkg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

// 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: 3 additions & 0 deletions cmd/gotype/gotype.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ To verify the output of a pipe:
echo "package foo" | gotype
*/

//go:debug gotypesalias=0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions cmd/ssadump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// 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
3 changes: 3 additions & 0 deletions cmd/stringer/stringer.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
// PillAspirin // Aspirin
//
// to suppress it in the output.

//go:debug gotypesalias=0

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

import (
Expand Down
3 changes: 3 additions & 0 deletions go/analysis/passes/defers/cmd/defers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// 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
3 changes: 3 additions & 0 deletions go/analysis/passes/fieldalignment/cmd/fieldalignment/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// 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
3 changes: 3 additions & 0 deletions go/analysis/passes/findcall/cmd/findcall/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// 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
3 changes: 3 additions & 0 deletions go/analysis/passes/httpmux/cmd/httpmux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// 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
3 changes: 3 additions & 0 deletions go/analysis/passes/ifaceassert/cmd/ifaceassert/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// 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
3 changes: 3 additions & 0 deletions go/analysis/passes/lostcancel/cmd/lostcancel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

// 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
3 changes: 3 additions & 0 deletions go/analysis/passes/nilness/cmd/nilness/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

// 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
3 changes: 3 additions & 0 deletions go/analysis/passes/shadow/cmd/shadow/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// license that can be found in the LICENSE file.

// The shadow command runs the shadow analyzer.

//go:debug gotypesalias=0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions go/analysis/passes/stringintconv/cmd/stringintconv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// license that can be found in the LICENSE file.

// The stringintconv command runs the stringintconv analyzer.

//go:debug gotypesalias=0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions go/analysis/passes/unmarshal/cmd/unmarshal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// license that can be found in the LICENSE file.

// The unmarshal command runs the unmarshal analyzer.

//go:debug gotypesalias=0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions go/analysis/passes/unusedresult/cmd/unusedresult/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

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

//go:debug gotypesalias=0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions go/packages/gopackages/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// how to use golang.org/x/tools/go/packages to load, parse,
// type-check, and print one or more Go packages.
// Its precise output is unspecified and may change.

//go:debug gotypesalias=0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions go/packages/internal/nodecount/nodecount.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// A typical distribution is 40% identifiers, 10% literals, 8%
// selectors, and 6% calls; around 3% each of BinaryExpr, BlockStmt,
// AssignStmt, Field, and Comment; and the rest accounting for 20%.

//go:debug gotypesalias=0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions go/types/internal/play/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
// It is intended for convenient exploration and debugging of
// go/types. The command and its web interface are not officially
// supported and they may be changed arbitrarily in the future.

//go:debug gotypesalias=0

package main

import (
Expand Down

0 comments on commit a24facf

Please sign in to comment.