MCPcopy Index your code
hub / github.com/go-git/go-git / GetZlibWriter

Function GetZlibWriter

utils/sync/zlib.go:65–69  ·  view source on GitHub ↗

GetZlibWriter returns a *zlib.Writer that is managed by a sync.Pool. Returns a writer that is reset with w and ready for use. After use, the *zlib.Writer should be put back into the sync.Pool by calling PutZlibWriter.

(w io.Writer)

Source from the content-addressed store, hash-verified

63// After use, the *zlib.Writer should be put back into the sync.Pool
64// by calling PutZlibWriter.
65func GetZlibWriter(w io.Writer) *zlib.Writer {
66 z := zlibWriter.Get().(*zlib.Writer)
67 z.Reset(w)
68 return z
69}
70
71// PutZlibWriter puts w back into its sync.Pool.
72func PutZlibWriter(w *zlib.Writer) {

Callers 2

NewWriterFunction · 0.92
TestGetAndPutZlibWriterFunction · 0.85

Calls 2

GetMethod · 0.65
ResetMethod · 0.45

Tested by 1

TestGetAndPutZlibWriterFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…