Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Escape ¶
Escape copies byte slice src to dst at a given index, adding escaping any quote or control characters. It returns the index at which the copy finished.
NB: ensure that dst is large enough to store src, additional quotation runes, and any additional escape characters. as generated by Quote, to dst and returns the extended buffer.
func EscapedLength ¶
EscapedLength computes the length required for a byte slice to hold a quoted byte slice.
NB: essentially a dry-run of `Escape` that does not write characters, but instead counts total character counts for the destination byte slice.
func NeedToEscape ¶
NeedToEscape returns true if the byte slice contains characters that will need to be escaped when quoting the slice.
func Quote ¶
Quote copies byte slice src to dst at a given index, adding quotation runes around the src slice and escaping any quote or control characters. It returns the index at which the copy finished.
NB: ensure that dst is large enough to store src, additional quotation runes, and any additional escape characters. as generated by Quote, to dst and returns the extended buffer.
NB: based on stconv.Quote method, but instead uses indexed insertion into a predefined buffer.
func QuoteSimple ¶
QuoteSimple copies byte slice src to dst at a given index, adding quotation runes around the src slice, but does not escape any characters. It returns the index at which the copy finished.
NB: ensure that dst is large enough to store src and two other characters.
func QuotedLength ¶
QuotedLength computes the length required for a byte slice to hold a quoted byte slice.
NB: essentially a dry-run of `Quote` that does not write characters, but instead counts total character counts for the destination byte slice.
Types ¶
This section is empty.