atLeastReader reads from R, stopping with EOF once at least N bytes have been read. It is different from an io.LimitedReader in that it doesn't cut short the last Read call, and in that it considers an early EOF an error.
| 875 | // read. It is different from an io.LimitedReader in that it doesn't cut short |
| 876 | // the last Read call, and in that it considers an early EOF an error. |
| 877 | type atLeastReader struct { |
| 878 | R io.Reader |
| 879 | N int64 |
| 880 | } |
| 881 | |
| 882 | func (r *atLeastReader) Read(p []byte) (int, error) { |
| 883 | if r.N <= 0 { |
nothing calls this directly
no outgoing calls
no test coverage detected