MCPcopy
hub / github.com/valyala/quicktemplate / ReleaseWriter

Function ReleaseWriter

writer.go:53–62  ·  view source on GitHub ↗

ReleaseWriter returns the writer to the pool. Do not access released writer, otherwise data races may occur.

(qw *Writer)

Source from the content-addressed store, hash-verified

51//
52// Do not access released writer, otherwise data races may occur.
53func ReleaseWriter(qw *Writer) {
54 hw := qw.e.w.(*htmlEscapeWriter)
55 hw.w = nil
56 qw.e.Reset()
57 qw.e.w = hw
58
59 qw.n.Reset()
60
61 writerPool.Put(qw)
62}
63
64var writerPool sync.Pool
65

Callers 2

TestWriterFunction · 0.85
testQWriterFunction · 0.85

Calls 1

ResetMethod · 0.45

Tested by 2

TestWriterFunction · 0.68
testQWriterFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…