aboutsummaryrefslogtreecommitdiff
path: root/src/io/io.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/io.go')
-rw-r--r--src/io/io.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/io/io.go b/src/io/io.go
index 3cab7288c9..9e4b86594d 100644
--- a/src/io/io.go
+++ b/src/io/io.go
@@ -420,6 +420,7 @@ func LimitReader(r Reader, n int64) Reader { return &LimitedReader{r, n} }
// A LimitedReader reads from R but limits the amount of
// data returned to just N bytes. Each call to Read
// updates N to reflect the new amount remaining.
+// Read returns EOF when N <= 0 or when the underlying R returns EOF.
type LimitedReader struct {
R Reader // underlying reader
N int64 // max bytes remaining