MCPcopy
hub / github.com/golang/groupcache / ByteSlice

Method ByteSlice

byteview.go:47–52  ·  view source on GitHub ↗

ByteSlice returns a copy of the data as a byte slice.

()

Source from the content-addressed store, hash-verified

45
46// ByteSlice returns a copy of the data as a byte slice.
47func (v ByteView) ByteSlice() []byte {
48 if v.b != nil {
49 return cloneBytes(v.b)
50 }
51 return []byte(v.s)
52}
53
54// String returns the data as a string, making a copy if necessary.
55func (v ByteView) String() string {

Callers

nothing calls this directly

Calls 1

cloneBytesFunction · 0.85

Tested by

no test coverage detected