@@ -53,7 +53,7 @@ func buildTestResponse(buf *bytes.Buffer) *testResponse {
53
53
statusParts := strings .Split (headers [0 ], " " , 3 )
54
54
response .statusCode , _ = strconv .Atoi (statusParts [1 ])
55
55
56
- for _ , h := range ( headers [1 :]) {
56
+ for _ , h := range headers [1 :] {
57
57
split := strings .Split (h , ":" , 2 )
58
58
name := strings .TrimSpace (split [0 ])
59
59
value := strings .TrimSpace (split [1 ])
@@ -193,7 +193,7 @@ func buildTestRequest(method string, path string, body string, headers map[strin
193
193
}
194
194
195
195
func TestRouting (t * testing.T ) {
196
- for _ , test := range ( tests ) {
196
+ for _ , test := range tests {
197
197
resp := getTestResponse (test .method , test .path , test .body , make (map [string ]string ))
198
198
199
199
if resp .statusCode != test .expectedStatus {
@@ -213,7 +213,7 @@ func TestRouting(t *testing.T) {
213
213
}
214
214
215
215
func TestHead (t * testing.T ) {
216
- for _ , test := range ( tests ) {
216
+ for _ , test := range tests {
217
217
218
218
if test .method != "GET" {
219
219
continue
@@ -252,7 +252,7 @@ func TestHead(t *testing.T) {
252
252
253
253
func buildScgiFields (fields map [string ]string , buf * bytes.Buffer ) []byte {
254
254
255
- for k , v := range ( fields ) {
255
+ for k , v := range fields {
256
256
buf .WriteString (k )
257
257
buf .Write ([]byte {0 })
258
258
buf .WriteString (v )
@@ -304,7 +304,7 @@ func buildTestScgiRequest(method string, path string, body string, headers map[s
304
304
}
305
305
306
306
func TestScgi (t * testing.T ) {
307
- for _ , test := range ( tests ) {
307
+ for _ , test := range tests {
308
308
req := buildTestScgiRequest (test .method , test .path , test .body , make (map [string ]string ))
309
309
var output bytes.Buffer
310
310
nb := tcpBuffer {input : req , output : & output }
@@ -322,7 +322,7 @@ func TestScgi(t *testing.T) {
322
322
}
323
323
324
324
func TestScgiHead (t * testing.T ) {
325
- for _ , test := range ( tests ) {
325
+ for _ , test := range tests {
326
326
327
327
if test .method != "GET" {
328
328
continue
@@ -400,7 +400,7 @@ func buildTestFcgiRequest(method string, path string, bodychunks []string, heade
400
400
fcgiHeaders := make (map [string ]string )
401
401
402
402
bodylength := 0
403
- for _ , s := range ( bodychunks ) {
403
+ for _ , s := range bodychunks {
404
404
bodylength += len (s )
405
405
}
406
406
@@ -421,7 +421,7 @@ func buildTestFcgiRequest(method string, path string, bodychunks []string, heade
421
421
req .Write (newFcgiRecord (fcgiBeginRequest , 0 , make ([]byte , 8 )))
422
422
423
423
var buf bytes.Buffer
424
- for k , v := range ( fcgiHeaders ) {
424
+ for k , v := range fcgiHeaders {
425
425
kv := buildFcgiKeyValue (k , v )
426
426
buf .Write (kv )
427
427
}
@@ -433,7 +433,7 @@ func buildTestFcgiRequest(method string, path string, bodychunks []string, heade
433
433
req .Write (newFcgiRecord (fcgiParams , 0 , []byte {}))
434
434
435
435
//send the body
436
- for _ , s := range ( bodychunks ) {
436
+ for _ , s := range bodychunks {
437
437
if len (s ) > 0 {
438
438
req .Write (newFcgiRecord (fcgiStdin , 0 , strings .Bytes (s )))
439
439
}
@@ -472,7 +472,7 @@ func getFcgiOutput(br *bytes.Buffer) *bytes.Buffer {
472
472
}
473
473
474
474
func TestFcgi (t * testing.T ) {
475
- for _ , test := range ( tests ) {
475
+ for _ , test := range tests {
476
476
req := buildTestFcgiRequest (test .method , test .path , []string {test .body }, make (map [string ]string ))
477
477
var output bytes.Buffer
478
478
nb := tcpBuffer {input : req , output : & output }
@@ -491,7 +491,7 @@ func TestFcgi(t *testing.T) {
491
491
}
492
492
493
493
func TestFcgiHead (t * testing.T ) {
494
- for _ , test := range ( tests ) {
494
+ for _ , test := range tests {
495
495
496
496
if test .method != "GET" {
497
497
continue
0 commit comments