mailbadger/app

Bug: Reading from stream(io.Reader) two times

djale1k opened this issue · 1 comments

With current implementation in Import Subscribers we are reading from the stream (io.Reader) two times, second read will be empty stream.

  1. CheckLines with limit func
  2. The actual read in import svc.

We can create a new reader from the same bytes and pass it along. Here's an example: https://siongui.github.io/2018/10/28/go-read-twice-from-same-io-reader/