Close releases a FmtCtx for reuse. Closing a FmtCtx is not required, but is recommended for performance-sensitive paths.
()
| 837 | // Close releases a FmtCtx for reuse. Closing a FmtCtx is not required, but is |
| 838 | // recommended for performance-sensitive paths. |
| 839 | func (ctx *FmtCtx) Close() { |
| 840 | ctx.Buffer.Reset() |
| 841 | *ctx = FmtCtx{ |
| 842 | Buffer: ctx.Buffer, |
| 843 | } |
| 844 | fmtCtxPool.Put(ctx) |
| 845 | } |
| 846 | |
| 847 | // CloseAndGetString combines Close() and String(). |
| 848 | func (ctx *FmtCtx) CloseAndGetString() string { |