diff options
author | qiulaidongfeng <2645477756@qq.com> | 2023-08-16 02:04:19 +0000 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2023-08-16 02:07:18 +0000 |
commit | 850b6ce33ced3d20d036cb41317f783469f3ea86 (patch) | |
tree | 809546e10dc891d93d7927f46e60cad51e53b6b0 /src/bufio | |
parent | 2f100187f6c4e279f4916cb25c58f33ff85ffaaf (diff) | |
download | go-850b6ce33ced3d20d036cb41317f783469f3ea86.tar.gz go-850b6ce33ced3d20d036cb41317f783469f3ea86.zip |
bufio: clarify the maximum token size
Fixes #43183.
Change-Id: I50d99ef8ed513bba47166a25ea5c7c80cd8bd799
GitHub-Last-Rev: 684d70e9a3dbc0ce280e1112105d666cd5754e9f
GitHub-Pull-Request: golang/go#61979
Reviewed-on: https://go-review.googlesource.com/c/go/+/518860
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/bufio')
-rw-r--r-- | src/bufio/scan.go | 8 |
1 files changed, 4 insertions, 4 deletions
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. |