MCPcopy Create free account
hub / github.com/cortexproject/cortex / Close

Method Close

pkg/util/grpcencoding/snappyblock/snappyblock.go:95–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93}
94
95func (w *writeCloser) Close() error {
96 defer func() {
97 w.buff.Reset()
98 w.dst = w.dst[0:cap(w.dst)]
99 w.pool.Put(w)
100 }()
101
102 if w.i != nil {
103 w.dst = snappy.Encode(w.dst, w.buff.Bytes())
104 _, err := w.i.Write(w.dst)
105 return err
106 }
107
108 return nil
109}
110
111type reader struct {
112 pool *sync.Pool

Callers

nothing calls this directly

Calls 5

PutMethod · 0.65
EncodeMethod · 0.65
BytesMethod · 0.65
ResetMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected