A small tweak to my previous PR - previously WriteExtensionRaw would cause the byte slice param to escape to heap (because of the call to io.Writer.Write in mw.Write) which meant there was still an allocation when using it with stack-allocated buffers. This fixes it by copying the data through the internal buffer.
A small tweak to my previous PR - previously WriteExtensionRaw would cause the byte slice param to escape to heap (because of the call to io.Writer.Write in mw.Write) which meant there was still an allocation when using it with stack-allocated buffers. This fixes it by copying the data through the internal buffer.