File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ import (
1616)
1717
1818var (
19- typeOfError = reflect .TypeOf (( * error )( nil )). Elem ()
20- typeOfContext = reflect .TypeOf (( * context .Context )( nil )). Elem ()
19+ typeOfError = reflect .TypeFor [ error ] ()
20+ typeOfContext = reflect .TypeFor [ context.Context ] ()
2121)
2222
2323// ServiceInfo service info.
Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ func (e RpcServiceInternalError) String() string {
3535
3636// Precompute the reflect type for error. Can't use error directly
3737// because Typeof takes an empty interface value. This is annoying.
38- var typeOfError = reflect .TypeOf (( * error )( nil )). Elem ()
38+ var typeOfError = reflect .TypeFor [ error ] ()
3939
4040// Precompute the reflect type for context.
41- var typeOfContext = reflect .TypeOf (( * context .Context )( nil )). Elem ()
41+ var typeOfContext = reflect .TypeFor [ context.Context ] ()
4242
4343type methodType struct {
4444 sync.Mutex // protects counters
You canโt perform that action at this time.
0 commit comments