diff options
| author | Russ Cox <rsc@golang.org> | 2021-12-01 12:15:45 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-12-13 18:45:54 +0000 |
| commit | 2580d0e08d5e9f979b943758d3c49877fb2324cb (patch) | |
| tree | 3aafccfd81087734156a1778ce2321adf345f271 /src/debug/dwarf | |
| parent | 083ef5462494e81ee23316245c5d65085a3f62d9 (diff) | |
| download | go-2580d0e08d5e9f979b943758d3c49877fb2324cb.tar.xz | |
all: gofmt -w -r 'interface{} -> any' src
And then revert the bootstrap cmd directories and certain testdata.
And adjust tests as needed.
Not reverting the changes in std that are bootstrapped,
because some of those changes would appear in API docs,
and we want to use any consistently.
Instead, rewrite 'any' to 'interface{}' in cmd/dist for those directories
when preparing the bootstrap copy.
A few files changed as a result of running gofmt -w
not because of interface{} -> any but because they
hadn't been updated for the new //go:build lines.
Fixes #49884.
Change-Id: Ie8045cba995f65bd79c694ec77a1b3d1fe01bb09
Reviewed-on: https://go-review.googlesource.com/c/go/+/368254
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/debug/dwarf')
| -rw-r--r-- | src/debug/dwarf/entry.go | 6 | ||||
| -rw-r--r-- | src/debug/dwarf/entry_test.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/debug/dwarf/entry.go b/src/debug/dwarf/entry.go index 25a3b5beec..cbdc838a12 100644 --- a/src/debug/dwarf/entry.go +++ b/src/debug/dwarf/entry.go @@ -261,7 +261,7 @@ type Entry struct { // ClassUnknown. type Field struct { Attr Attr - Val interface{} + Val any Class Class } @@ -382,7 +382,7 @@ func (i Class) GoString() string { // the check that the value has the expected dynamic type, as in: // v, ok := e.Val(AttrSibling).(int64) // -func (e *Entry) Val(a Attr) interface{} { +func (e *Entry) Val(a Attr) any { if f := e.AttrField(a); f != nil { return f.Val } @@ -501,7 +501,7 @@ func (b *buf) entry(cu *Entry, atab abbrevTable, ubase Offset, vers int) *Entry fmt = format(b.uint()) e.Field[i].Class = formToClass(fmt, a.field[i].attr, vers, b) } - var val interface{} + var val any switch fmt { default: b.error("unknown entry attr format 0x" + strconv.FormatInt(int64(fmt), 16)) diff --git a/src/debug/dwarf/entry_test.go b/src/debug/dwarf/entry_test.go index 1f41d742ea..8c6ca7259e 100644 --- a/src/debug/dwarf/entry_test.go +++ b/src/debug/dwarf/entry_test.go @@ -277,7 +277,7 @@ func TestUnitIteration(t *testing.T) { for _, file := range files { t.Run(file, func(t *testing.T) { d := elfData(t, file) - var units [2][]interface{} + var units [2][]any for method := range units { for r := d.Reader(); ; { ent, err := r.Next() |
