1
0
mirror of https://github.com/golang/go synced 2024-11-23 08:20:05 -07:00

net/rpc: use reflect.TypeFor for known types

For #60088

Change-Id: I56586b68d5e38a46560f4ced19214f1d2db2850e
Reviewed-on: https://go-review.googlesource.com/c/go/+/514995
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Ian Lance Taylor 2023-08-01 12:38:43 -07:00 committed by Gopher Robot
parent f8966594fa
commit 64939f62aa

View File

@ -146,9 +146,8 @@ const (
DefaultDebugPath = "/debug/rpc"
)
// Precompute the reflect type for error. Can't use error directly
// because Typeof takes an empty interface value. This is annoying.
var typeOfError = reflect.TypeOf((*error)(nil)).Elem()
// Precompute the reflect type for error.
var typeOfError = reflect.TypeFor[error]()
type methodType struct {
sync.Mutex // protects counters