putBuilder returns a strings.Builder to the pool.
(sb *strings.Builder)
| 42 | |
| 43 | // putBuilder returns a strings.Builder to the pool. |
| 44 | func putBuilder(sb *strings.Builder) { |
| 45 | if sb == nil { |
| 46 | return |
| 47 | } |
| 48 | // Don't pool very large builders to avoid holding excess memory. |
| 49 | if sb.Cap() > 64*1024 { |
| 50 | return |
| 51 | } |
| 52 | builderPool.Put(sb) |
| 53 | } |
| 54 | |
| 55 | // SQL returns the SQL string representation of the AST. |
| 56 | func (a AST) SQL() string { |