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/obj/link.go | |
| 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/obj/link.go')
| -rw-r--r-- | src/cmd/internal/obj/link.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index 9f3814e748..85dca33d27 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -211,7 +211,7 @@ type Addr struct { // for TYPE_FCONST, a float64 // for TYPE_BRANCH, a *Prog (optional) // for TYPE_TEXTSIZE, an int32 (optional) - Val interface{} + Val any } type AddrName int8 @@ -464,7 +464,7 @@ type LSym struct { P []byte R []Reloc - Extra *interface{} // *FuncInfo, *VarInfo, *FileInfo, *TypeInfo, or *ItabInfo, if present + Extra *any // *FuncInfo, *VarInfo, *FileInfo, *TypeInfo, or *ItabInfo, if present Pkg string PkgIdx int32 @@ -523,7 +523,7 @@ func (s *LSym) NewFuncInfo() *FuncInfo { panic(fmt.Sprintf("invalid use of LSym - NewFuncInfo with Extra of type %T", *s.Extra)) } f := new(FuncInfo) - s.Extra = new(interface{}) + s.Extra = new(any) *s.Extra = f return f } @@ -547,7 +547,7 @@ func (s *LSym) NewVarInfo() *VarInfo { panic(fmt.Sprintf("invalid use of LSym - NewVarInfo with Extra of type %T", *s.Extra)) } f := new(VarInfo) - s.Extra = new(interface{}) + s.Extra = new(any) *s.Extra = f return f } @@ -574,7 +574,7 @@ func (s *LSym) NewFileInfo() *FileInfo { panic(fmt.Sprintf("invalid use of LSym - NewFileInfo with Extra of type %T", *s.Extra)) } f := new(FileInfo) - s.Extra = new(interface{}) + s.Extra = new(any) *s.Extra = f return f } @@ -591,7 +591,7 @@ func (s *LSym) File() *FileInfo { // A TypeInfo contains information for a symbol // that contains a runtime._type. type TypeInfo struct { - Type interface{} // a *cmd/compile/internal/types.Type + Type any // a *cmd/compile/internal/types.Type } func (s *LSym) NewTypeInfo() *TypeInfo { @@ -599,7 +599,7 @@ func (s *LSym) NewTypeInfo() *TypeInfo { panic(fmt.Sprintf("invalid use of LSym - NewTypeInfo with Extra of type %T", *s.Extra)) } t := new(TypeInfo) - s.Extra = new(interface{}) + s.Extra = new(any) *s.Extra = t return t } @@ -616,7 +616,7 @@ func (s *LSym) TypeInfo() *TypeInfo { // An ItabInfo contains information for a symbol // that contains a runtime.itab. type ItabInfo struct { - Type interface{} // a *cmd/compile/internal/types.Type + Type any // a *cmd/compile/internal/types.Type } func (s *LSym) NewItabInfo() *ItabInfo { @@ -624,7 +624,7 @@ func (s *LSym) NewItabInfo() *ItabInfo { panic(fmt.Sprintf("invalid use of LSym - NewItabInfo with Extra of type %T", *s.Extra)) } t := new(ItabInfo) - s.Extra = new(interface{}) + s.Extra = new(any) *s.Extra = t return t } @@ -1178,7 +1178,7 @@ type Link struct { DwFixups *DwarfFixupTable DwTextCount int Imports []goobj.ImportedPkg - DiagFunc func(string, ...interface{}) + DiagFunc func(string, ...any) DiagFlush func() DebugInfo func(ctxt *Link, fn *LSym, info *LSym, curfn Func) ([]dwarf.Scope, dwarf.InlCalls) GenAbstractFunc func(fn *LSym) @@ -1223,12 +1223,12 @@ func _(ctxt *Link) { } } -func (ctxt *Link) Diag(format string, args ...interface{}) { +func (ctxt *Link) Diag(format string, args ...any) { ctxt.Errors++ ctxt.DiagFunc(format, args...) } -func (ctxt *Link) Logf(format string, args ...interface{}) { +func (ctxt *Link) Logf(format string, args ...any) { fmt.Fprintf(ctxt.Bso, format, args...) ctxt.Bso.Flush() } |
