@@ -12,7 +12,7 @@ import (
12
12
13
13
func Test_Get (t * testing.T ) {
14
14
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
15
- fmt .Fprintln (w , "Hello, Get" )
15
+ _ , _ = fmt .Fprintln (w , "Hello, Get" )
16
16
}))
17
17
defer ts .Close ()
18
18
@@ -33,7 +33,7 @@ func Test_Get(t *testing.T) {
33
33
34
34
func Test_PostBodyNil (t * testing.T ) {
35
35
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
36
- fmt .Fprintln (w , "Hello, Post" )
36
+ _ , _ = fmt .Fprintln (w , "Hello, Post" )
37
37
}))
38
38
defer ts .Close ()
39
39
@@ -50,7 +50,7 @@ func Test_PostBodyNil(t *testing.T) {
50
50
51
51
func Test_PostBodyError (t * testing.T ) {
52
52
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
53
- fmt .Fprintln (w , "Hello, Post" )
53
+ _ , _ = fmt .Fprintln (w , "Hello, Post" )
54
54
}))
55
55
defer ts .Close ()
56
56
@@ -84,7 +84,7 @@ func Test_PostServerNotFound(t *testing.T) {
84
84
85
85
func Test_Post (t * testing.T ) {
86
86
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
87
- fmt .Fprintln (w , "Hello, Post" )
87
+ _ , _ = fmt .Fprintln (w , "Hello, Post" )
88
88
}))
89
89
defer ts .Close ()
90
90
@@ -103,7 +103,7 @@ func Test_Post(t *testing.T) {
103
103
104
104
func Test_Post_List (t * testing.T ) {
105
105
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
106
- fmt .Fprintln (w , "Hello, Post" )
106
+ _ , _ = fmt .Fprintln (w , "Hello, Post" )
107
107
}))
108
108
defer ts .Close ()
109
109
@@ -122,7 +122,7 @@ func Test_Post_List(t *testing.T) {
122
122
123
123
func Test_Put (t * testing.T ) {
124
124
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
125
- fmt .Fprintln (w , "Hello, Put" )
125
+ _ , _ = fmt .Fprintln (w , "Hello, Put" )
126
126
}))
127
127
defer ts .Close ()
128
128
@@ -141,7 +141,7 @@ func Test_Put(t *testing.T) {
141
141
142
142
func Test_Patch (t * testing.T ) {
143
143
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
144
- fmt .Fprintln (w , "Hello, Patch" )
144
+ _ , _ = fmt .Fprintln (w , "Hello, Patch" )
145
145
}))
146
146
defer ts .Close ()
147
147
@@ -160,7 +160,7 @@ func Test_Patch(t *testing.T) {
160
160
161
161
func Test_Delete (t * testing.T ) {
162
162
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
163
- fmt .Fprintln (w , "Hello, Delete" )
163
+ _ , _ = fmt .Fprintln (w , "Hello, Delete" )
164
164
}))
165
165
defer ts .Close ()
166
166
@@ -178,7 +178,7 @@ func Test_Delete(t *testing.T) {
178
178
179
179
func Test_Req (t * testing.T ) {
180
180
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
181
- fmt .Fprintln (w , "Hello, Req Post" )
181
+ _ , _ = fmt .Fprintln (w , "Hello, Req Post" )
182
182
}))
183
183
defer ts .Close ()
184
184
@@ -213,7 +213,7 @@ func Test_Req(t *testing.T) {
213
213
214
214
func Test_ReqEncoded (t * testing.T ) {
215
215
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
216
- fmt .Fprintln (w , "Hello, Req Post" )
216
+ _ , _ = fmt .Fprintln (w , "Hello, Req Post" )
217
217
}))
218
218
defer ts .Close ()
219
219
@@ -242,7 +242,7 @@ func Test_ReqEncoded(t *testing.T) {
242
242
243
243
func Test_ReqMethodNotFound (t * testing.T ) {
244
244
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
245
- fmt .Fprintln (w , "Hello, Post" )
245
+ _ , _ = fmt .Fprintln (w , "Hello, Post" )
246
246
}))
247
247
defer ts .Close ()
248
248
@@ -262,7 +262,7 @@ func Test_ReqMethodNotFound(t *testing.T) {
262
262
263
263
func Benchmark_CallXRequests (b * testing.B ) {
264
264
ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
265
- fmt .Fprintln (w , "Hello, World" )
265
+ _ , _ = fmt .Fprintln (w , "Hello, World" )
266
266
}))
267
267
defer ts .Close ()
268
268
@@ -279,31 +279,31 @@ func Benchmark_CallXRequests(b *testing.B) {
279
279
280
280
b .Run ("GET" , func (b * testing.B ) {
281
281
for i := 0 ; i < b .N ; i ++ {
282
- _ = req .Get ("/todos/1" )
282
+ _ = req .Get ("/todos/1?id=1 " )
283
283
}
284
284
})
285
285
286
286
b .Run ("POST" , func (b * testing.B ) {
287
287
for i := 0 ; i < b .N ; i ++ {
288
- _ = req .Post ("/todos" , nil )
288
+ _ = req .Post ("/todos?id=1 " , nil )
289
289
}
290
290
})
291
291
292
292
b .Run ("PUT" , func (b * testing.B ) {
293
293
for i := 0 ; i < b .N ; i ++ {
294
- _ = req .Put ("/todos/1" , nil )
294
+ _ = req .Put ("/todos/1?id=1 " , nil )
295
295
}
296
296
})
297
297
298
298
b .Run ("PATCH" , func (b * testing.B ) {
299
299
for i := 0 ; i < b .N ; i ++ {
300
- _ = req .Patch ("/todos/1" , nil )
300
+ _ = req .Patch ("/todos/1?id=1 " , nil )
301
301
}
302
302
})
303
303
304
304
b .Run ("DELETE" , func (b * testing.B ) {
305
305
for i := 0 ; i < b .N ; i ++ {
306
- _ = req .Delete ("/todos/1" )
306
+ _ = req .Delete ("/todos/1?id=1 " )
307
307
}
308
308
})
309
309
}
0 commit comments