diff options
| author | Alan Donovan <adonovan@google.com> | 2025-11-11 14:48:22 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-11-11 19:59:40 -0800 |
| commit | 4bfc3a9d14c0b3bfcfe4ce987e47cda6720785a2 (patch) | |
| tree | 0cbf1ec55d3a61af8bf45ac4a00af7e7bcc426db /src/cmd/internal/objabi | |
| parent | 2263d4aabdde8a4a466009ecc356501f87c7efb7 (diff) | |
| download | go-4bfc3a9d14c0b3bfcfe4ce987e47cda6720785a2.tar.xz | |
std,cmd: go fix -any std cmd
This change mechanically replaces all occurrences of interface{}
by 'any' (where deemed safe by the 'any' modernizer) throughout
std and cmd, minus their vendor trees.
Since this fix is relatively numerous, it gets its own CL.
Also, 'go generate go/types'.
Change-Id: I14a6b52856c3291c1d27935409bca8d5fd4242a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/719702
Commit-Queue: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/cmd/internal/objabi')
| -rw-r--r-- | src/cmd/internal/objabi/flag.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/internal/objabi/flag.go b/src/cmd/internal/objabi/flag.go index 8709c4e5cf..32d71d0575 100644 --- a/src/cmd/internal/objabi/flag.go +++ b/src/cmd/internal/objabi/flag.go @@ -85,7 +85,7 @@ var buildID string // filled in by linker type versionFlag struct{} func (versionFlag) IsBoolFlag() bool { return true } -func (versionFlag) Get() interface{} { return nil } +func (versionFlag) Get() any { return nil } func (versionFlag) String() string { return "" } func (versionFlag) Set(s string) error { name := os.Args[0] @@ -148,7 +148,7 @@ func (c *count) Set(s string) error { return nil } -func (c *count) Get() interface{} { +func (c *count) Get() any { return int(*c) } @@ -206,8 +206,8 @@ func DecodeArg(arg string) string { type debugField struct { name string help string - concurrentOk bool // true if this field/flag is compatible with concurrent compilation - val interface{} // *int or *string + concurrentOk bool // true if this field/flag is compatible with concurrent compilation + val any // *int or *string } type DebugFlag struct { @@ -234,7 +234,7 @@ type DebugSSA func(phase, flag string, val int, valString string) string // // If debugSSA is non-nil, any debug flags of the form ssa/... will be // passed to debugSSA for processing. -func NewDebugFlag(debug interface{}, debugSSA DebugSSA) *DebugFlag { +func NewDebugFlag(debug any, debugSSA DebugSSA) *DebugFlag { flag := &DebugFlag{ tab: make(map[string]debugField), debugSSA: debugSSA, |
