ReleaseWriter returns the writer to the pool. Do not access released writer, otherwise data races may occur.
(qw *Writer)
| 51 | // |
| 52 | // Do not access released writer, otherwise data races may occur. |
| 53 | func 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 | |
| 64 | var writerPool sync.Pool |
| 65 |
searching dependent graphs…