Build the output in a bytes.Buffer to avoid creating small strings which are passed to Join.
Use stack arrays to avoid allocations for small buffers, and AppendQuote/AvailableBuffer avoids allocating and copying in the case that buffer space is sufficient.
Build the output in a
bytes.Buffer
to avoid creating small strings which are passed toJoin
.Use stack arrays to avoid allocations for small buffers, and
AppendQuote
/AvailableBuffer
avoids allocating and copying in the case that buffer space is sufficient.