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/plugin | |
parent | 083ef5462494e81ee23316245c5d65085a3f62d9 (diff) | |
download | go-2580d0e08d5e9f979b943758d3c49877fb2324cb.tar.gz go-2580d0e08d5e9f979b943758d3c49877fb2324cb.zip |
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/plugin')
-rw-r--r-- | src/plugin/plugin.go | 4 | ||||
-rw-r--r-- | src/plugin/plugin_dlopen.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/plugin/plugin.go b/src/plugin/plugin.go index 4a524bfa3f..b2a0fbe3ea 100644 --- a/src/plugin/plugin.go +++ b/src/plugin/plugin.go @@ -22,7 +22,7 @@ type Plugin struct { pluginpath string err string // set if plugin failed to load loaded chan struct{} // closed when loaded - syms map[string]interface{} + syms map[string]any } // Open opens a Go plugin. @@ -69,4 +69,4 @@ func (p *Plugin) Lookup(symName string) (Symbol, error) { // } // *v.(*int) = 7 // f.(func())() // prints "Hello, number 7" -type Symbol interface{} +type Symbol any diff --git a/src/plugin/plugin_dlopen.go b/src/plugin/plugin_dlopen.go index 5fff329fc5..c59f11ef71 100644 --- a/src/plugin/plugin_dlopen.go +++ b/src/plugin/plugin_dlopen.go @@ -102,7 +102,7 @@ func open(name string) (*Plugin, error) { } // Fill out the value of each plugin symbol. - updatedSyms := map[string]interface{}{} + updatedSyms := map[string]any{} for symName, sym := range syms { isFunc := symName[0] == '.' if isFunc { @@ -147,7 +147,7 @@ var ( ) // lastmoduleinit is defined in package runtime -func lastmoduleinit() (pluginpath string, syms map[string]interface{}, errstr string) +func lastmoduleinit() (pluginpath string, syms map[string]any, errstr string) // doInit is defined in package runtime //go:linkname doInit runtime.doInit |