Skip to content

Commit fbff2ab

Browse files
authored
*: update interface{} to any and go.mod version to go 1.19 (#6544)
1 parent e40da66 commit fbff2ab

File tree

154 files changed

+603
-639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+603
-639
lines changed

Diff for: attributes/attributes.go

+16-17
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,26 @@ import (
3434
// key/value pairs. Keys must be hashable, and users should define their own
3535
// types for keys. Values should not be modified after they are added to an
3636
// Attributes or if they were received from one. If values implement 'Equal(o
37-
// interface{}) bool', it will be called by (*Attributes).Equal to determine
38-
// whether two values with the same key should be considered equal.
37+
// any) bool', it will be called by (*Attributes).Equal to determine whether
38+
// two values with the same key should be considered equal.
3939
type Attributes struct {
40-
m map[interface{}]interface{}
40+
m map[any]any
4141
}
4242

4343
// New returns a new Attributes containing the key/value pair.
44-
func New(key, value interface{}) *Attributes {
45-
return &Attributes{m: map[interface{}]interface{}{key: value}}
44+
func New(key, value any) *Attributes {
45+
return &Attributes{m: map[any]any{key: value}}
4646
}
4747

4848
// WithValue returns a new Attributes containing the previous keys and values
4949
// and the new key/value pair. If the same key appears multiple times, the
5050
// last value overwrites all previous values for that key. To remove an
5151
// existing key, use a nil value. value should not be modified later.
52-
func (a *Attributes) WithValue(key, value interface{}) *Attributes {
52+
func (a *Attributes) WithValue(key, value any) *Attributes {
5353
if a == nil {
5454
return New(key, value)
5555
}
56-
n := &Attributes{m: make(map[interface{}]interface{}, len(a.m)+1)}
56+
n := &Attributes{m: make(map[any]any, len(a.m)+1)}
5757
for k, v := range a.m {
5858
n.m[k] = v
5959
}
@@ -63,20 +63,19 @@ func (a *Attributes) WithValue(key, value interface{}) *Attributes {
6363

6464
// Value returns the value associated with these attributes for key, or nil if
6565
// no value is associated with key. The returned value should not be modified.
66-
func (a *Attributes) Value(key interface{}) interface{} {
66+
func (a *Attributes) Value(key any) any {
6767
if a == nil {
6868
return nil
6969
}
7070
return a.m[key]
7171
}
7272

73-
// Equal returns whether a and o are equivalent. If 'Equal(o interface{})
74-
// bool' is implemented for a value in the attributes, it is called to
75-
// determine if the value matches the one stored in the other attributes. If
76-
// Equal is not implemented, standard equality is used to determine if the two
77-
// values are equal. Note that some types (e.g. maps) aren't comparable by
78-
// default, so they must be wrapped in a struct, or in an alias type, with Equal
79-
// defined.
73+
// Equal returns whether a and o are equivalent. If 'Equal(o any) bool' is
74+
// implemented for a value in the attributes, it is called to determine if the
75+
// value matches the one stored in the other attributes. If Equal is not
76+
// implemented, standard equality is used to determine if the two values are
77+
// equal. Note that some types (e.g. maps) aren't comparable by default, so
78+
// they must be wrapped in a struct, or in an alias type, with Equal defined.
8079
func (a *Attributes) Equal(o *Attributes) bool {
8180
if a == nil && o == nil {
8281
return true
@@ -93,7 +92,7 @@ func (a *Attributes) Equal(o *Attributes) bool {
9392
// o missing element of a
9493
return false
9594
}
96-
if eq, ok := v.(interface{ Equal(o interface{}) bool }); ok {
95+
if eq, ok := v.(interface{ Equal(o any) bool }); ok {
9796
if !eq.Equal(ov) {
9897
return false
9998
}
@@ -122,7 +121,7 @@ func (a *Attributes) String() string {
122121
return sb.String()
123122
}
124123

125-
func str(x interface{}) string {
124+
func str(x any) string {
126125
if v, ok := x.(fmt.Stringer); ok {
127126
return v.String()
128127
} else if v, ok := x.(string); ok {

Diff for: attributes/attributes_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type stringVal struct {
2929
s string
3030
}
3131

32-
func (s stringVal) Equal(o interface{}) bool {
32+
func (s stringVal) Equal(o any) bool {
3333
os, ok := o.(stringVal)
3434
return ok && s.s == os.s
3535
}

Diff for: authz/audit/stdout/stdout_logger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type logger struct {
5656

5757
// Log marshals the audit.Event to json and prints it to standard output.
5858
func (l *logger) Log(event *audit.Event) {
59-
jsonContainer := map[string]interface{}{
59+
jsonContainer := map[string]any{
6060
"grpc_audit_log": convertEvent(event),
6161
}
6262
jsonBytes, err := json.Marshal(jsonContainer)

Diff for: authz/audit/stdout/stdout_logger_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ func (s) TestStdoutLogger_Log(t *testing.T) {
7272

7373
auditLogger.Log(test.event)
7474

75-
var container map[string]interface{}
75+
var container map[string]any
7676
if err := json.Unmarshal(buf.Bytes(), &container); err != nil {
7777
t.Fatalf("Failed to unmarshal audit log event: %v", err)
7878
}
79-
innerEvent := extractEvent(container["grpc_audit_log"].(map[string]interface{}))
79+
innerEvent := extractEvent(container["grpc_audit_log"].(map[string]any))
8080
if innerEvent.Timestamp == "" {
8181
t.Fatalf("Resulted event has no timestamp: %v", innerEvent)
8282
}
@@ -116,7 +116,7 @@ func (s) TestStdoutLoggerBuilder_Registration(t *testing.T) {
116116

117117
// extractEvent extracts an stdout.event from a map
118118
// unmarshalled from a logged json message.
119-
func extractEvent(container map[string]interface{}) event {
119+
func extractEvent(container map[string]any) event {
120120
return event{
121121
FullMethodName: container["rpc_method"].(string),
122122
Principal: container["principal"].(string),

Diff for: authz/grpc_authz_server_interceptors.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func NewStatic(authzPolicy string) (*StaticInterceptor, error) {
5858
// UnaryInterceptor intercepts incoming Unary RPC requests.
5959
// Only authorized requests are allowed to pass. Otherwise, an unauthorized
6060
// error is returned to the client.
61-
func (i *StaticInterceptor) UnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
61+
func (i *StaticInterceptor) UnaryInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) {
6262
err := i.engines.IsAuthorized(ctx)
6363
if err != nil {
6464
if status.Code(err) == codes.PermissionDenied {
@@ -75,7 +75,7 @@ func (i *StaticInterceptor) UnaryInterceptor(ctx context.Context, req interface{
7575
// StreamInterceptor intercepts incoming Stream RPC requests.
7676
// Only authorized requests are allowed to pass. Otherwise, an unauthorized
7777
// error is returned to the client.
78-
func (i *StaticInterceptor) StreamInterceptor(srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
78+
func (i *StaticInterceptor) StreamInterceptor(srv any, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
7979
err := i.engines.IsAuthorized(ss.Context())
8080
if err != nil {
8181
if status.Code(err) == codes.PermissionDenied {
@@ -166,13 +166,13 @@ func (i *FileWatcherInterceptor) Close() {
166166
// UnaryInterceptor intercepts incoming Unary RPC requests.
167167
// Only authorized requests are allowed to pass. Otherwise, an unauthorized
168168
// error is returned to the client.
169-
func (i *FileWatcherInterceptor) UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
169+
func (i *FileWatcherInterceptor) UnaryInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) {
170170
return ((*StaticInterceptor)(atomic.LoadPointer(&i.internalInterceptor))).UnaryInterceptor(ctx, req, info, handler)
171171
}
172172

173173
// StreamInterceptor intercepts incoming Stream RPC requests.
174174
// Only authorized requests are allowed to pass. Otherwise, an unauthorized
175175
// error is returned to the client.
176-
func (i *FileWatcherInterceptor) StreamInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
176+
func (i *FileWatcherInterceptor) StreamInterceptor(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
177177
return ((*StaticInterceptor)(atomic.LoadPointer(&i.internalInterceptor))).StreamInterceptor(srv, ss, info, handler)
178178
}

Diff for: authz/rbac_translator_test.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func TestTranslatePolicy(t *testing.T) {
308308
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
309309
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_NONE,
310310
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
311-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{}, "stdout_logger")},
311+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{}, "stdout_logger")},
312312
IsOptional: false,
313313
},
314314
},
@@ -342,7 +342,7 @@ func TestTranslatePolicy(t *testing.T) {
342342
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
343343
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_ON_ALLOW,
344344
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
345-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{}, "stdout_logger")},
345+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{}, "stdout_logger")},
346346
IsOptional: false,
347347
},
348348
},
@@ -404,7 +404,7 @@ func TestTranslatePolicy(t *testing.T) {
404404
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
405405
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_ON_DENY,
406406
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
407-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{}, "stdout_logger")},
407+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{}, "stdout_logger")},
408408
IsOptional: false,
409409
},
410410
},
@@ -438,7 +438,7 @@ func TestTranslatePolicy(t *testing.T) {
438438
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
439439
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_ON_DENY_AND_ALLOW,
440440
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
441-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{}, "stdout_logger")},
441+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{}, "stdout_logger")},
442442
IsOptional: false,
443443
},
444444
},
@@ -500,7 +500,7 @@ func TestTranslatePolicy(t *testing.T) {
500500
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
501501
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_NONE,
502502
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
503-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{}, "stdout_logger")},
503+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{}, "stdout_logger")},
504504
IsOptional: false,
505505
},
506506
},
@@ -534,7 +534,7 @@ func TestTranslatePolicy(t *testing.T) {
534534
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
535535
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_NONE,
536536
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
537-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{}, "stdout_logger")},
537+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{}, "stdout_logger")},
538538
IsOptional: false,
539539
},
540540
},
@@ -596,7 +596,7 @@ func TestTranslatePolicy(t *testing.T) {
596596
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
597597
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_NONE,
598598
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
599-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{"abc": 123, "xyz": "123"}, "stdout_logger")},
599+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{"abc": 123, "xyz": "123"}, "stdout_logger")},
600600
IsOptional: false,
601601
},
602602
},
@@ -630,7 +630,7 @@ func TestTranslatePolicy(t *testing.T) {
630630
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
631631
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_NONE,
632632
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
633-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{"abc": 123, "xyz": "123"}, "stdout_logger")},
633+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{"abc": 123, "xyz": "123"}, "stdout_logger")},
634634
IsOptional: false,
635635
},
636636
},
@@ -688,7 +688,7 @@ func TestTranslatePolicy(t *testing.T) {
688688
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
689689
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_NONE,
690690
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
691-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{"abc": 123, "xyz": map[string]interface{}{"abc": 123}}, "stdout_logger")},
691+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{"abc": 123, "xyz": map[string]any{"abc": 123}}, "stdout_logger")},
692692
IsOptional: false,
693693
},
694694
},
@@ -792,7 +792,7 @@ func TestTranslatePolicy(t *testing.T) {
792792
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
793793
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_NONE,
794794
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
795-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{}, "stdout_logger")},
795+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{}, "stdout_logger")},
796796
IsOptional: false,
797797
},
798798
},
@@ -853,7 +853,7 @@ func TestTranslatePolicy(t *testing.T) {
853853
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
854854
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_ON_DENY,
855855
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
856-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{}, "stdout_logger")},
856+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{}, "stdout_logger")},
857857
IsOptional: false,
858858
},
859859
},
@@ -887,7 +887,7 @@ func TestTranslatePolicy(t *testing.T) {
887887
AuditLoggingOptions: &v3rbacpb.RBAC_AuditLoggingOptions{
888888
AuditCondition: v3rbacpb.RBAC_AuditLoggingOptions_ON_DENY,
889889
LoggerConfigs: []*v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
890-
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]interface{}{}, "stdout_logger")},
890+
{AuditLogger: &v3corepb.TypedExtensionConfig{Name: "stdout_logger", TypedConfig: anyPbHelper(t, map[string]any{}, "stdout_logger")},
891891
IsOptional: false,
892892
},
893893
},
@@ -1034,7 +1034,7 @@ func TestTranslatePolicy(t *testing.T) {
10341034
}
10351035
}
10361036

1037-
func anyPbHelper(t *testing.T, in map[string]interface{}, name string) *anypb.Any {
1037+
func anyPbHelper(t *testing.T, in map[string]any, name string) *anypb.Any {
10381038
t.Helper()
10391039
pb, err := structpb.NewStruct(in)
10401040
typedStruct := &v1xdsudpatypepb.TypedStruct{

Diff for: balancer/balancer.go

+6-7
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ type DoneInfo struct {
270270
// trailing metadata.
271271
//
272272
// The only supported type now is *orca_v3.LoadReport.
273-
ServerLoad interface{}
273+
ServerLoad any
274274
}
275275

276276
var (
@@ -414,15 +414,14 @@ var ErrBadResolverState = errors.New("bad resolver state")
414414
type ProducerBuilder interface {
415415
// Build creates a Producer. The first parameter is always a
416416
// grpc.ClientConnInterface (a type to allow creating RPCs/streams on the
417-
// associated SubConn), but is declared as interface{} to avoid a
418-
// dependency cycle. Should also return a close function that will be
419-
// called when all references to the Producer have been given up.
420-
Build(grpcClientConnInterface interface{}) (p Producer, close func())
417+
// associated SubConn), but is declared as `any` to avoid a dependency
418+
// cycle. Should also return a close function that will be called when all
419+
// references to the Producer have been given up.
420+
Build(grpcClientConnInterface any) (p Producer, close func())
421421
}
422422

423423
// A Producer is a type shared among potentially many consumers. It is
424424
// associated with a SubConn, and an implementation will typically contain
425425
// other methods to provide additional functionality, e.g. configuration or
426426
// subscription registration.
427-
type Producer interface {
428-
}
427+
type Producer any

Diff for: balancer/rls/control_channel_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (s) TestLookupFailure(t *testing.T) {
109109
// respond within the configured rpc timeout.
110110
func (s) TestLookupDeadlineExceeded(t *testing.T) {
111111
// A unary interceptor which returns a status error with DeadlineExceeded.
112-
interceptor := func(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
112+
interceptor := func(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error) {
113113
return nil, status.Error(codes.DeadlineExceeded, "deadline exceeded")
114114
}
115115

@@ -191,7 +191,7 @@ func (f *testPerRPCCredentials) RequireTransportSecurity() bool {
191191

192192
// Unary server interceptor which validates if the RPC contains call credentials
193193
// which match `perRPCCredsData
194-
func callCredsValidatingServerInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
194+
func callCredsValidatingServerInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error) {
195195
md, ok := metadata.FromIncomingContext(ctx)
196196
if !ok {
197197
return nil, status.Error(codes.PermissionDenied, "didn't find metadata in context")

Diff for: balancer/rls/picker_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (s) TestPick_DataCacheMiss_PendingEntryExists(t *testing.T) {
158158
// also lead to creation of a pending entry, and further RPCs by the
159159
// client should not result in RLS requests being sent out.
160160
rlsReqCh := make(chan struct{}, 1)
161-
interceptor := func(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
161+
interceptor := func(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error) {
162162
rlsReqCh <- struct{}{}
163163
<-ctx.Done()
164164
return nil, ctx.Err()
@@ -633,7 +633,7 @@ func (s) TestPick_DataCacheHit_PendingEntryExists_StaleEntry(t *testing.T) {
633633
// expired entry and a pending entry in the cache.
634634
rlsReqCh := make(chan struct{}, 1)
635635
firstRPCDone := grpcsync.NewEvent()
636-
interceptor := func(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
636+
interceptor := func(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error) {
637637
select {
638638
case rlsReqCh <- struct{}{}:
639639
default:
@@ -733,7 +733,7 @@ func (s) TestPick_DataCacheHit_PendingEntryExists_ExpiredEntry(t *testing.T) {
733733
// expired entry and a pending entry in the cache.
734734
rlsReqCh := make(chan struct{}, 1)
735735
firstRPCDone := grpcsync.NewEvent()
736-
interceptor := func(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
736+
interceptor := func(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error) {
737737
select {
738738
case rlsReqCh <- struct{}{}:
739739
default:

Diff for: balancer/weightedroundrobin/weightedroundrobin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type AddrInfo struct {
4444
}
4545

4646
// Equal allows the values to be compared by Attributes.Equal.
47-
func (a AddrInfo) Equal(o interface{}) bool {
47+
func (a AddrInfo) Equal(o any) bool {
4848
oa, ok := o.(AddrInfo)
4949
return ok && oa.Weight == a.Weight
5050
}

0 commit comments

Comments
 (0)