MCPcopy Create free account
hub / github.com/XTLS/Go / atLeastReader

Struct atLeastReader

conn.go:877–880  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
877type atLeastReader struct {
878 R io.Reader
879 N int64
880}
881
882func (r *atLeastReader) Read(p []byte) (int, error) {
883 if r.N <= 0 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected