@@ -68,12 +68,11 @@ func (s) TestRecvBufferPoolStream(t *testing.T) {
68
68
FullDuplexCallF : func (stream testgrpc.TestService_FullDuplexCallServer ) error {
69
69
for i := 0 ; i < reqCount ; i ++ {
70
70
preparedMsg := & grpc.PreparedMsg {}
71
- err := preparedMsg .Encode (stream , & testgrpc.StreamingOutputCallResponse {
71
+ if err := preparedMsg .Encode (stream , & testgrpc.StreamingOutputCallResponse {
72
72
Payload : & testgrpc.Payload {
73
73
Body : []byte {'0' + uint8 (i )},
74
74
},
75
- })
76
- if err != nil {
75
+ }); err != nil {
77
76
return err
78
77
}
79
78
stream .SendMsg (preparedMsg )
@@ -83,7 +82,6 @@ func (s) TestRecvBufferPoolStream(t *testing.T) {
83
82
}
84
83
85
84
pool := & checkBufferPool {}
86
-
87
85
sopts := []grpc.ServerOption {experimental .RecvBufferPool (pool )}
88
86
dopts := []grpc.DialOption {experimental .WithRecvBufferPool (pool )}
89
87
if err := ss .Start (sopts , dopts ... ); err != nil {
@@ -96,7 +94,7 @@ func (s) TestRecvBufferPoolStream(t *testing.T) {
96
94
97
95
stream , err := ss .Client .FullDuplexCall (ctx , tc .callOpts ... )
98
96
if err != nil {
99
- t .Fatalf ("ss.Client.FullDuplexCall failed: %f " , err )
97
+ t .Fatalf ("ss.Client.FullDuplexCall failed: %v " , err )
100
98
}
101
99
102
100
var ngot int
@@ -160,7 +158,6 @@ func (s) TestRecvBufferPoolUnary(t *testing.T) {
160
158
}
161
159
162
160
pool := & checkBufferPool {}
163
-
164
161
sopts := []grpc.ServerOption {experimental .RecvBufferPool (pool )}
165
162
dopts := []grpc.DialOption {experimental .WithRecvBufferPool (pool )}
166
163
if err := ss .Start (sopts , dopts ... ); err != nil {
@@ -173,17 +170,16 @@ func (s) TestRecvBufferPoolUnary(t *testing.T) {
173
170
174
171
const reqCount = 10
175
172
for i := 0 ; i < reqCount ; i ++ {
176
- _ , err := ss .Client .UnaryCall (
173
+ if _ , err := ss .Client .UnaryCall (
177
174
ctx ,
178
175
& testgrpc.SimpleRequest {
179
176
Payload : & testgrpc.Payload {
180
177
Body : make ([]byte , largeSize ),
181
178
},
182
179
},
183
180
tc .callOpts ... ,
184
- )
185
- if err != nil {
186
- t .Fatalf ("ss.Client.UnaryCall failed: %f" , err )
181
+ ); err != nil {
182
+ t .Fatalf ("ss.Client.UnaryCall failed: %v" , err )
187
183
}
188
184
}
189
185
0 commit comments