diff --git a/src/bufio/scan.go b/src/bufio/scan.go index e247cbcf32..5c2782f438 100644 --- a/src/bufio/scan.go +++ b/src/bufio/scan.go @@ -255,10 +255,10 @@ func (s *Scanner) setErr(err error) { } } -// Buffer sets the initial buffer to use when scanning and the maximum -// size of buffer that may be allocated during scanning. The maximum -// token size is the larger of max and cap(buf). If max <= cap(buf), -// Scan will use this buffer only and do no allocation. +// Buffer sets the initial buffer to use when scanning +// and the maximum size of buffer that may be allocated during scanning. +// The maximum token size must be less than the larger of max and cap(buf). +// If max <= cap(buf), Scan will use this buffer only and do no allocation. // // By default, Scan uses an internal buffer and sets the // maximum token size to MaxScanTokenSize.