Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bytes ¶ added in v2.3.0
Bytes returns a []byte view of s without allocation for any string- or byte-slice-backed type. It relies on string and slice headers both starting with the data pointer (guaranteed by the gc runtime layout, and the same assumption UnsafeString makes). When S's underlying type is string, the result aliases immutable memory and must only be read.
func UnsafeBytes ¶
UnsafeBytes returns a byte slice view of s without allocation.
func UnsafeString ¶
UnsafeString returns a string view of b without allocation.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.