| Conditions | 3 |
| Total Lines | 9 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package helpers |
||
| 23 | func MakeTestServerWithMultipleResponses(responseCode int, responses [][]byte) *httptest.Server { |
||
| 24 | count := 0 |
||
| 25 | return httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { |
||
| 26 | res.WriteHeader(responseCode) |
||
| 27 | _, err := res.Write(responses[count]) |
||
| 28 | if err != nil { |
||
| 29 | panic(err) |
||
| 30 | } |
||
| 31 | count++ |
||
| 32 | })) |
||
| 57 |