1
0
mirror of https://github.com/golang/go synced 2024-07-08 12:18:55 +00:00

bufio: clarify the maximum token size

Fixes #43183

Change-Id: I50d99ef8ed513bba47166a25ea5c7c80cd8bd799
This commit is contained in:
qiulaidongfeng 2023-08-12 18:17:55 +08:00
parent ac64a3628b
commit 684d70e9a3

View File

@ -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.