MCPcopy Create free account
hub / github.com/golang/groupcache / ByteView

Struct ByteView

byteview.go:32–36  ·  view source on GitHub ↗

A ByteView holds an immutable view of bytes. Internally it wraps either a []byte or a string, but that detail is invisible to callers. A ByteView is meant to be used as a value type, not a pointer (like a time.Time).

Source from the content-addressed store, hash-verified

30// A ByteView is meant to be used as a value type, not
31// a pointer (like a time.Time).
32type ByteView struct {
33 // If b is non-nil, b is used, else s is used.
34 b []byte
35 s string
36}
37
38// Len returns the view's length.
39func (v ByteView) Len() int {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected