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

Function TruncatingByteSliceSink

sinks.go:273–275  ·  view source on GitHub ↗

TruncatingByteSliceSink returns a Sink that writes up to len(*dst) bytes to *dst. If more bytes are available, they're silently truncated. If fewer bytes are available than len(*dst), *dst is shrunk to fit the number of bytes available.

(dst *[]byte)

Source from the content-addressed store, hash-verified

271// truncated. If fewer bytes are available than len(*dst), *dst
272// is shrunk to fit the number of bytes available.
273func TruncatingByteSliceSink(dst *[]byte) Sink {
274 return &truncBytesSink{dst: dst}
275}
276
277type truncBytesSink struct {
278 dst *[]byte

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…