File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,10 @@ var simpleServiceServiceDesc = grpc.ServiceDesc{
66
66
Metadata : "simple.proto" ,
67
67
}
68
68
69
+ // simpleServicePingHandler handles ping requests
70
+ // This function must follow gRPC's required signature, where context is the second parameter.
71
+ //
72
+ //nolint:revive // context-as-argument: gRPC handler requires this signature
69
73
func simpleServicePingHandler (
70
74
srv interface {},
71
75
ctx context.Context ,
@@ -103,6 +107,7 @@ type simpleServiceClient struct {
103
107
cc grpc.ClientConnInterface
104
108
}
105
109
110
+ // NewSimpleServiceClient creates a new client
106
111
func NewSimpleServiceClient (cc grpc.ClientConnInterface ) SimpleServiceClient {
107
112
return & simpleServiceClient {cc }
108
113
}
@@ -121,6 +126,11 @@ func (c *simpleServiceClient) Ping(
121
126
return out , nil
122
127
}
123
128
129
+ // TestGRPCLoadBalancingPolicies tests how different load balancing policies behave
130
+ // This is a test function, so we can ignore the staticcheck warnings about deprecated methods
131
+ // as we need to use these specific gRPC APIs for testing the load balancing behavior.
132
+ //
133
+ //nolint:staticcheck
124
134
func TestGRPCLoadBalancingPolicies (t * testing.T ) {
125
135
// Start several real gRPC servers with different characteristics
126
136
servers := make ([]* simpleServer , 3 )
You can’t perform that action at this time.
0 commit comments