WriteBatch writes the values in batch to zw. If an error occurs, WriteBatch stops and returns the error.
(zw sio.Writer, batch Batch)
| 34 | // WriteBatch writes the values in batch to zw. If an error occurs, WriteBatch |
| 35 | // stops and returns the error. |
| 36 | func WriteBatch(zw sio.Writer, batch Batch) error { |
| 37 | vals := batch.Values() |
| 38 | for i := range vals { |
| 39 | if err := zw.Write(vals[i]); err != nil { |
| 40 | return err |
| 41 | } |
| 42 | } |
| 43 | return nil |
| 44 | } |
| 45 | |
| 46 | // A Puller produces Batches of records, signaling end-of-stream (EOS) by returning |
| 47 | // a nil Batch and nil error. The done argument to Pull indicates that the stream |
no test coverage detected