MCPcopy Create free account
hub / github.com/djherbis/buffer / NewSpill

Function NewSpill

spill.go:17–25  ·  view source on GitHub ↗

NewSpill returns a Buffer which writes data to w when there's an error writing to buf. Such as when buf is full, or the disk is full, etc.

(buf Buffer, w io.Writer)

Source from the content-addressed store, hash-verified

15// NewSpill returns a Buffer which writes data to w when there's an error
16// writing to buf. Such as when buf is full, or the disk is full, etc.
17func NewSpill(buf Buffer, w io.Writer) Buffer {
18 if w == nil {
19 w = ioutil.Discard
20 }
21 return &spill{
22 Buffer: buf,
23 Spiller: w,
24 }
25}
26
27func (buf *spill) Cap() int64 {
28 return math.MaxInt64

Callers 3

TestSpillFunction · 0.85
TestSpill2Function · 0.85
TestNoSpillFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestSpillFunction · 0.68
TestSpill2Function · 0.68
TestNoSpillFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…