Skip to content

Commit 0f03c74

Browse files
.*: fix revive lint issues unused-parameter (#7580)
1 parent 6147c81 commit 0f03c74

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

credentials/alts/alts_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ type testServer struct {
467467
testgrpc.UnimplementedTestServiceServer
468468
}
469469

470-
func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
470+
func (s *testServer) UnaryCall(_ context.Context, _ *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
471471
return &testpb.SimpleResponse{
472472
Payload: &testpb.Payload{},
473473
}, nil

examples/features/unix_abstract/server/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type ecServer struct {
4444
addr string
4545
}
4646

47-
func (s *ecServer) UnaryEcho(ctx context.Context, req *pb.EchoRequest) (*pb.EchoResponse, error) {
47+
func (s *ecServer) UnaryEcho(_ context.Context, req *pb.EchoRequest) (*pb.EchoResponse, error) {
4848
return &pb.EchoResponse{Message: fmt.Sprintf("%s (from %s)", req.Message, s.addr)}, nil
4949
}
5050

gcp/observability/logging_test.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ func (s) TestBothClientAndServerRPCEvents(t *testing.T) {
589589
defer cleanup()
590590

591591
ss := &stubserver.StubServer{
592-
UnaryCallF: func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
592+
UnaryCallF: func(_ context.Context, _ *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
593593
return &testpb.SimpleResponse{}, nil
594594
},
595595
FullDuplexCallF: func(stream testgrpc.TestService_FullDuplexCallServer) error {
@@ -650,7 +650,7 @@ func (s) TestClientRPCEventsTruncateHeaderAndMetadata(t *testing.T) {
650650
newLoggingExporter = ne
651651
}(newLoggingExporter)
652652

653-
newLoggingExporter = func(ctx context.Context, config *config) (loggingExporter, error) {
653+
newLoggingExporter = func(_ context.Context, _ *config) (loggingExporter, error) {
654654
return fle, nil
655655
}
656656

@@ -673,7 +673,7 @@ func (s) TestClientRPCEventsTruncateHeaderAndMetadata(t *testing.T) {
673673
defer cleanup()
674674

675675
ss := &stubserver.StubServer{
676-
UnaryCallF: func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
676+
UnaryCallF: func(_ context.Context, _ *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
677677
return &testpb.SimpleResponse{}, nil
678678
},
679679
}
@@ -787,7 +787,7 @@ func (s) TestPrecedenceOrderingInConfiguration(t *testing.T) {
787787
newLoggingExporter = ne
788788
}(newLoggingExporter)
789789

790-
newLoggingExporter = func(ctx context.Context, config *config) (loggingExporter, error) {
790+
newLoggingExporter = func(_ context.Context, _ *config) (loggingExporter, error) {
791791
return fle, nil
792792
}
793793

@@ -822,10 +822,10 @@ func (s) TestPrecedenceOrderingInConfiguration(t *testing.T) {
822822
defer cleanup()
823823

824824
ss := &stubserver.StubServer{
825-
EmptyCallF: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) {
825+
EmptyCallF: func(_ context.Context, _ *testpb.Empty) (*testpb.Empty, error) {
826826
return &testpb.Empty{}, nil
827827
},
828-
UnaryCallF: func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
828+
UnaryCallF: func(_ context.Context, _ *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
829829
return &testpb.SimpleResponse{}, nil
830830
},
831831
FullDuplexCallF: func(stream testgrpc.TestService_FullDuplexCallServer) error {
@@ -1125,7 +1125,7 @@ func (s) TestMetadataTruncationAccountsKey(t *testing.T) {
11251125
newLoggingExporter = ne
11261126
}(newLoggingExporter)
11271127

1128-
newLoggingExporter = func(ctx context.Context, config *config) (loggingExporter, error) {
1128+
newLoggingExporter = func(_ context.Context, _ *config) (loggingExporter, error) {
11291129
return fle, nil
11301130
}
11311131

@@ -1149,7 +1149,7 @@ func (s) TestMetadataTruncationAccountsKey(t *testing.T) {
11491149
defer cleanup()
11501150

11511151
ss := &stubserver.StubServer{
1152-
UnaryCallF: func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
1152+
UnaryCallF: func(_ context.Context, _ *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
11531153
return &testpb.SimpleResponse{}, nil
11541154
},
11551155
}
@@ -1240,6 +1240,7 @@ func (s) TestMetadataTruncationAccountsKey(t *testing.T) {
12401240
// TestMethodInConfiguration tests different method names with an expectation on
12411241
// whether they should error or not.
12421242
func (s) TestMethodInConfiguration(t *testing.T) {
1243+
12431244
// To skip creating a stackdriver exporter.
12441245
fle := &fakeLoggingExporter{
12451246
t: t,
@@ -1249,7 +1250,7 @@ func (s) TestMethodInConfiguration(t *testing.T) {
12491250
newLoggingExporter = ne
12501251
}(newLoggingExporter)
12511252

1252-
newLoggingExporter = func(ctx context.Context, config *config) (loggingExporter, error) {
1253+
newLoggingExporter = func(_ context.Context, _ *config) (loggingExporter, error) {
12531254
return fle, nil
12541255
}
12551256

interop/grpclb_fallback/client_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func doRPCAndGetPath(client testgrpc.TestServiceClient, timeout time.Duration) t
7575
}
7676

7777
func dialTCPUserTimeout(ctx context.Context, addr string) (net.Conn, error) {
78-
control := func(network, address string, c syscall.RawConn) error {
78+
control := func(_, _ string, c syscall.RawConn) error {
7979
var syscallErr error
8080
controlErr := c.Control(func(fd uintptr) {
8181
syscallErr = syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT, 20000)

xds/internal/balancer/clusterimpl/clusterimpl.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func (b *clusterImplBalancer) ResolverError(err error) {
275275
})
276276
}
277277

278-
func (b *clusterImplBalancer) updateSubConnState(sc balancer.SubConn, s balancer.SubConnState, cb func(balancer.SubConnState)) {
278+
func (b *clusterImplBalancer) updateSubConnState(_ balancer.SubConn, s balancer.SubConnState, cb func(balancer.SubConnState)) {
279279
// Trigger re-resolution when a SubConn turns transient failure. This is
280280
// necessary for the LogicalDNS in cluster_resolver policy to re-resolve.
281281
//
@@ -297,7 +297,7 @@ func (b *clusterImplBalancer) UpdateSubConnState(sc balancer.SubConn, s balancer
297297
}
298298

299299
func (b *clusterImplBalancer) Close() {
300-
b.serializer.TrySchedule(func(ctx context.Context) {
300+
b.serializer.TrySchedule(func(_ context.Context) {
301301
b.child.Close()
302302
b.childState = balancer.State{}
303303

0 commit comments

Comments
 (0)