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/dwarf | |
| 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/dwarf')
| -rw-r--r-- | src/cmd/internal/dwarf/dwarf.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/cmd/internal/dwarf/dwarf.go b/src/cmd/internal/dwarf/dwarf.go index 6e06f139b0..b8956b4cff 100644 --- a/src/cmd/internal/dwarf/dwarf.go +++ b/src/cmd/internal/dwarf/dwarf.go @@ -40,8 +40,7 @@ const AbstractFuncSuffix = "$abstract" var logDwarf bool // Sym represents a symbol. -type Sym interface { -} +type Sym any // A Var represents a local variable or a function parameter. type Var struct { @@ -194,16 +193,16 @@ type Context interface { Size(s Sym) int64 AddInt(s Sym, size int, i int64) AddBytes(s Sym, b []byte) - AddAddress(s Sym, t interface{}, ofs int64) - AddCURelativeAddress(s Sym, t interface{}, ofs int64) - AddSectionOffset(s Sym, size int, t interface{}, ofs int64) - AddDWARFAddrSectionOffset(s Sym, t interface{}, ofs int64) - AddIndirectTextRef(s Sym, t interface{}) + AddAddress(s Sym, t any, ofs int64) + AddCURelativeAddress(s Sym, t any, ofs int64) + AddSectionOffset(s Sym, size int, t any, ofs int64) + AddDWARFAddrSectionOffset(s Sym, t any, ofs int64) + AddIndirectTextRef(s Sym, t any) CurrentOffset(s Sym) int64 RecordDclReference(from Sym, to Sym, dclIdx int, inlIndex int) RecordChildDieOffsets(s Sym, vars []*Var, offsets []int32) AddString(s Sym, v string) - Logf(format string, args ...interface{}) + Logf(format string, args ...any) } // AppendUleb128 appends v to b using DWARF's unsigned LEB128 encoding. @@ -874,7 +873,7 @@ type DWAttr struct { Atr uint16 // DW_AT_ Cls uint8 // DW_CLS_ Value int64 - Data interface{} + Data any } // DWDie represents a DWARF debug info entry. @@ -886,7 +885,7 @@ type DWDie struct { Sym Sym } -func putattr(ctxt Context, s Sym, abbrev int, form int, cls int, value int64, data interface{}) error { +func putattr(ctxt Context, s Sym, abbrev int, form int, cls int, value int64, data any) error { switch form { case DW_FORM_addr: // address // Allow nil addresses for DW_AT_go_runtime_type. |
