flâneur — a map of the web's best reading

bytes package - bytes - Go Packages

pkg.go.dev · 7,811 words · saved by 1 readers

Package bytes implements functions for the manipulation of byte slices. It is analogous to the facilities of the strings package. MinRead is the minimum slice size passed to a Read call by Buffer.ReadFrom. As long as the Buffer has at least MinRead bytes beyond what is required to hold the contents of r, ReadFrom will not grow the underlying buffer. ErrTooLarge is passed to panic if memory cannot be allocated to store data in a buffer. Clone returns a copy of b[:len(b)]. The result may have additional unused capacity. Clone(nil) returns nil. Compare returns an integer comparing two byte slices lexicographically. The result will be 0 if a == b, -1 if a b. A nil argument is equivalent to an empty slice. Contains reports whether subslice is within b. ContainsAny reports whether any of the UTF-8-encoded code points in chars are within b. ContainsRune reports whether the rune is contained in the UTF-8-encoded byte slice b. Count counts the number of non-overlapping instan

Documentation ¶ Rendered for linux/amd64 windows/amd64 darwin/amd64 js/wasm Overview ¶ Package bytes implements functions for the manipulation of byte slices. It is analogous to the facilities of the strings package. Index ¶ Constants Variables func Clone(b []byte) []byte func Compare(a, b []byte) int func Contains(b, subslice []byte) bool func ContainsAny(b []byte, chars string) bool func ContainsFunc(b []byte, f func(rune) bool) bool func ContainsRune(b []byte, r rune) bool func Count(s, sep []byte) int func Cut(s, sep []byte) (before, after []byte, found bool) func CutPrefix(s, prefix []byt

Explore this link on the map →

related reading