diff options
| author | Lokesh Kumar <lkumar94@gmail.com> | 2025-05-21 14:48:21 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-05-21 11:05:26 -0700 |
| commit | 304d9e2fd1b62d236eb48ec838be3680cb7845e6 (patch) | |
| tree | 9103516649b433a2824908287744dac66415f1df /src/bufio | |
| parent | d3d22cc5e4be996345e47d6994c5f3d5f51811fa (diff) | |
| download | go-304d9e2fd1b62d236eb48ec838be3680cb7845e6.tar.xz | |
bufio: update buffer documentation
Fixes #73778
Change-Id: If6d87a92786c9b0ee2bd790b57937919afe0fc5c
GitHub-Last-Rev: 4b4c7595d5779a127b01a5d71adca91cb5aa6c05
GitHub-Pull-Request: golang/go#73804
Reviewed-on: https://go-review.googlesource.com/c/go/+/674695
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/bufio')
| -rw-r--r-- | src/bufio/scan.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bufio/scan.go b/src/bufio/scan.go index a26b2ff17d..1a0a3907c9 100644 --- a/src/bufio/scan.go +++ b/src/bufio/scan.go @@ -260,8 +260,11 @@ func (s *Scanner) setErr(err error) { } } -// Buffer sets the initial buffer to use when scanning +// Buffer controls memory allocation by the Scanner. +// It sets the initial buffer to use when scanning // and the maximum size of buffer that may be allocated during scanning. +// The contents of the buffer are ignored. +// // The maximum token size must be less than the larger of max and cap(buf). // If max <= cap(buf), [Scanner.Scan] will use this buffer only and do no allocation. // |
