chore: change interface{} to any (#2818)

* chore: change interface{} to any

* chore: update goctl version to 1.5.0

* chore: update goctl deps
This commit is contained in:
Kevin Wan
2023-01-24 16:32:02 +08:00
committed by GitHub
parent 7e0ac77139
commit ae87114282
221 changed files with 1910 additions and 2207 deletions

View File

@@ -19,7 +19,7 @@ import (
func TestUnaryOpenTracingInterceptor_Disable(t *testing.T) {
_, err := UnaryTracingInterceptor(context.Background(), nil, &grpc.UnaryServerInfo{
FullMethod: "/",
}, func(ctx context.Context, req interface{}) (interface{}, error) {
}, func(ctx context.Context, req any) (any, error) {
return nil, nil
})
assert.Nil(t, err)
@@ -36,7 +36,7 @@ func TestUnaryOpenTracingInterceptor_Enabled(t *testing.T) {
_, err := UnaryTracingInterceptor(context.Background(), nil, &grpc.UnaryServerInfo{
FullMethod: "/package.TestService.GetUser",
}, func(ctx context.Context, req interface{}) (interface{}, error) {
}, func(ctx context.Context, req any) (any, error) {
return nil, nil
})
assert.Nil(t, err)
@@ -48,7 +48,7 @@ func TestUnaryTracingInterceptor(t *testing.T) {
wg.Add(1)
_, err := UnaryTracingInterceptor(context.Background(), nil, &grpc.UnaryServerInfo{
FullMethod: "/",
}, func(ctx context.Context, req interface{}) (interface{}, error) {
}, func(ctx context.Context, req any) (any, error) {
defer wg.Done()
atomic.AddInt32(&run, 1)
return nil, nil
@@ -84,7 +84,7 @@ func TestUnaryTracingInterceptor_WithError(t *testing.T) {
ctx := metadata.NewIncomingContext(context.Background(), md)
_, err := UnaryTracingInterceptor(ctx, nil, &grpc.UnaryServerInfo{
FullMethod: "/",
}, func(ctx context.Context, req interface{}) (interface{}, error) {
}, func(ctx context.Context, req any) (any, error) {
defer wg.Done()
return nil, test.err
})
@@ -103,7 +103,7 @@ func TestStreamTracingInterceptor_GrpcFormat(t *testing.T) {
stream := mockedServerStream{ctx: ctx}
err := StreamTracingInterceptor(nil, &stream, &grpc.StreamServerInfo{
FullMethod: "/foo",
}, func(svr interface{}, stream grpc.ServerStream) error {
}, func(svr any, stream grpc.ServerStream) error {
defer wg.Done()
atomic.AddInt32(&run, 1)
return nil
@@ -140,7 +140,7 @@ func TestStreamTracingInterceptor_FinishWithGrpcError(t *testing.T) {
stream := mockedServerStream{ctx: ctx}
err := StreamTracingInterceptor(nil, &stream, &grpc.StreamServerInfo{
FullMethod: "/foo",
}, func(svr interface{}, stream grpc.ServerStream) error {
}, func(svr any, stream grpc.ServerStream) error {
defer wg.Done()
return test.err
})
@@ -177,7 +177,7 @@ func TestStreamTracingInterceptor_WithError(t *testing.T) {
stream := mockedServerStream{ctx: ctx}
err := StreamTracingInterceptor(nil, &stream, &grpc.StreamServerInfo{
FullMethod: "/foo",
}, func(svr interface{}, stream grpc.ServerStream) error {
}, func(svr any, stream grpc.ServerStream) error {
defer wg.Done()
return test.err
})
@@ -270,10 +270,10 @@ func (m *mockedServerStream) Context() context.Context {
return m.ctx
}
func (m *mockedServerStream) SendMsg(v interface{}) error {
func (m *mockedServerStream) SendMsg(v any) error {
return m.err
}
func (m *mockedServerStream) RecvMsg(v interface{}) error {
func (m *mockedServerStream) RecvMsg(v any) error {
return m.err
}