ByteView and Sink Internals in Groupcache
ByteView: an immutable view over bytes or strings
The ByteView type is a tiny, zero-allocation wrapper that can hold either a []byte or a string. Internally it is nothing more than
type ByteView struct {
b []byte
s string
}
Exactly one of the two fields is non-nil/-empty; the other must be zero. All exported methods respect this invari ...
Posted on Thu, 24 Sep 2026 16:54:46 +0000 by waynewex