bufio: update buffer documentation

Fixes #73778

Change-Id: If6d87a92786c9b0ee2bd790b57937919afe0fc5c
GitHub-Last-Rev: 4b4c7595d5
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>
This commit is contained in:
Lokesh Kumar 2025-05-21 14:48:21 +00:00 committed by Gopher Robot
parent d3d22cc5e4
commit 304d9e2fd1
1 changed files with 4 additions and 1 deletions

View File

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