Closed flowchartsman closed 2 years ago
When input is provided as a []byte
the returned ParseJson will reference the input data.
For NDJSON, when using ParseND(b []byte, ...)
the returned structure will reference b
. For ParseNDStream
it is safer, and you only need to not reference whatever you send back on the reuse
channel.
It's not clear from the docs what the limitations of
WithCopyStrings(false)
are. Specifically, the godoc says:What are these circumstances, and what are the best-practices needed to avoid them? I'm assuming that this is mostly referring to retaining references to strings after the next document has been loaded in an NDJson situation, but is it safe to use these strings, provided they are copied? It would be very helpful to have this called out in the docs.