This package provides quoted string support similar to the strconv.Quote
and
strconv.Unquote
class of functions, but specifically tailored to the
RFC 7230 definition of quoted strings.
Please see the package documentation for details.
package main
import "github.com/TheCount/go-qunq/qunq"
const testString = `quote "scary" unquote`
func main() {
quoted, err := qunq.QuoteString(testString)
if err != nil {
panic(err)
}
println(quoted)
unquoted, err := qunq.UnquoteString(quoted)
if err != nil {
panic(err)
}
println(unquoted)
}