(w io.Writer, parts int, data []byte)
| 284 | func voidCheck(*http.Request) {} |
| 285 | |
| 286 | func writeParts(w io.Writer, parts int, data []byte) { |
| 287 | partSize := len(data) / parts |
| 288 | i := 0 |
| 289 | for ; i+partSize <= len(data); i += partSize { |
| 290 | w.Write(data[i : i+partSize]) |
| 291 | time.Sleep(streamingDelay) |
| 292 | if f, ok := w.(http.Flusher); ok { |
| 293 | f.Flush() |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | w.Write(data[i:]) |
| 298 | } |
| 299 | |
| 300 | func startTestServer(payload []byte, parts int, check requestCheck) *httptest.Server { |
| 301 | return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
no test coverage detected
searching dependent graphs…