go/src/bytes
Aaron Chen b57962b7c7 bytes: fix panic in bytes.Buffer.Peek
This change fixed the overlooked offset in bytes.Buffer.Peek.
Otherwise, it will either return wrong result or panic with
"runtime error: slice bounds out of range".

Change-Id: Ic42fd8a27fb9703c51430f298933b91cf0d45451
GitHub-Last-Rev: fb97ebc3b1
GitHub-Pull-Request: golang/go#76165
Reviewed-on: https://go-review.googlesource.com/c/go/+/717640
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-11-14 11:01:17 -08:00
..
boundary_test.go bytes: add a boundary test for Count of 1 byte 2023-11-30 20:05:58 +00:00
buffer.go bytes: fix panic in bytes.Buffer.Peek 2025-11-14 11:01:17 -08:00
buffer_test.go bytes: fix panic in bytes.Buffer.Peek 2025-11-14 11:01:17 -08:00
bytes.go bytes,strings: remove reference to non-existent SplitFunc 2025-09-16 09:42:15 -07:00
bytes_js_wasm_test.go internal/bytealg: extend memchr result correctly on wasm 2024-07-17 07:00:20 +00:00
bytes_test.go all: remove extra space in the comments 2025-11-03 10:05:39 -08:00
compare_test.go bytes: remove builders check from compare test 2023-07-13 23:11:42 +00:00
example_test.go bytes, strings: rename parameters in ExampleCut{Pre,Suf}fix 2025-05-12 09:07:54 -07:00
export_test.go bytes, internal/bytealg: simplify Equal 2019-04-24 00:56:36 +00:00
iter.go unicode/utf8: make DecodeRune{,InString} inlineable 2025-09-03 07:04:47 -07:00
iter_test.go bytes, strings: reduce Split{,After}Seq heap allocations 2025-05-05 19:08:23 -07:00
reader.go bytes: more cross-references in docstrings 2024-07-16 18:17:37 +00:00
reader_test.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00