]> Cypherpunks repositories - gostls13.git/commitdiff
bufio: update buffer documentation
authorLokesh Kumar <lkumar94@gmail.com>
Wed, 21 May 2025 14:48:21 +0000 (14:48 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 21 May 2025 18:05:26 +0000 (11:05 -0700)
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>
src/bufio/scan.go

index a26b2ff17d3a26a423a94a4c54cf44b7a4d1227d..1a0a3907c9eb8584ebbafa5bbd9dc34511080691 100644 (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.
 //