MCPcopy Index your code
hub / github.com/golang/groupcache / setBytesOwned

Method setBytesOwned

sinks.go:249–257  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

247}
248
249func (s *allocBytesSink) setBytesOwned(b []byte) error {
250 if s.dst == nil {
251 return errors.New("nil AllocatingByteSliceSink *[]byte dst")
252 }
253 *s.dst = cloneBytes(b) // another copy, protecting the read-only s.v.b view
254 s.v.b = b
255 s.v.s = ""
256 return nil
257}
258
259func (s *allocBytesSink) SetString(v string) error {
260 if s.dst == nil {

Callers 2

SetProtoMethod · 0.95
SetBytesMethod · 0.95

Calls 1

cloneBytesFunction · 0.85

Tested by

no test coverage detected