Skip to content

Commit f49f3ec

Browse files
authored
rpc: use reflect.TypeFor (#32316)
1 parent e7189b5 commit f49f3ec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rpc/service.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ import (
2929
)
3030

3131
var (
32-
contextType = reflect.TypeOf((*context.Context)(nil)).Elem()
33-
errorType = reflect.TypeOf((*error)(nil)).Elem()
34-
subscriptionType = reflect.TypeOf(Subscription{})
35-
stringType = reflect.TypeOf("")
32+
contextType = reflect.TypeFor[context.Context]()
33+
errorType = reflect.TypeFor[error]()
34+
subscriptionType = reflect.TypeFor[Subscription]()
35+
stringType = reflect.TypeFor[string]()
3636
)
3737

3838
type serviceRegistry struct {

0 commit comments

Comments
 (0)