File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -132,10 +132,11 @@ func (b *Reader) readErr() error {
132
132
return err
133
133
}
134
134
135
- // Peek returns the next n bytes without advancing the reader. The bytes stop
136
- // being valid at the next read call. If Peek returns fewer than n bytes, it
137
- // also returns an error explaining why the read is short. The error is
138
- // [ErrBufferFull] if n is larger than b's buffer size.
135
+ // Peek returns the next n bytes without advancing the reader. If b.Buffered() < n,
136
+ // tries to read a new chunk into b's buffer. The bytes stop being valid at the
137
+ // next read call. If Peek returns fewer than n bytes, it also returns an error
138
+ // explaining why the read is short. The error is [ErrBufferFull] if n is larger
139
+ // than b's buffer size.
139
140
//
140
141
// Calling Peek prevents a [Reader.UnreadByte] or [Reader.UnreadRune] call from succeeding
141
142
// until the next read operation.
You can’t perform that action at this time.
0 commit comments