mirror of
https://github.com/golang/go
synced 2024-11-22 05:14:40 -07:00
unsafe: clarify when String bytes can be modified
They can be modified when the string returned by String no longer exists. Fixes #68300 Change-Id: I526a068151f7aad1ab6827504b51a84e7399cafe Reviewed-on: https://go-review.googlesource.com/c/go/+/596955 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Commit-Queue: Ian Lance Taylor <iant@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
5565462a86
commit
6d89b38ed8
@ -260,7 +260,7 @@ func SliceData(slice []ArbitraryType) *ArbitraryType
|
||||
// a run-time panic occurs.
|
||||
//
|
||||
// Since Go strings are immutable, the bytes passed to String
|
||||
// must not be modified afterwards.
|
||||
// must not be modified as long as the returned string value exists.
|
||||
func String(ptr *byte, len IntegerType) string
|
||||
|
||||
// StringData returns a pointer to the underlying bytes of str.
|
||||
|
Loading…
Reference in New Issue
Block a user