diff options
author | 2021-09-10 14:42:14 +0200 | |
---|---|---|
committer | 2021-09-10 14:42:14 +0200 | |
commit | f2e5bedea6fb93fbbf68ed8f7153c353cc57a9f0 (patch) | |
tree | 475ae9e7470d0df670ab2a59dce351cd1d07498a /vendor/github.com/goccy/go-json/internal/encoder/string.go | |
parent | fixes + db changes (#204) (diff) | |
download | gotosocial-f2e5bedea6fb93fbbf68ed8f7153c353cc57a9f0.tar.xz |
migrate go version to 1.17 (#203)
* migrate go version to 1.17
* update contributing
Diffstat (limited to 'vendor/github.com/goccy/go-json/internal/encoder/string.go')
-rw-r--r-- | vendor/github.com/goccy/go-json/internal/encoder/string.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vendor/github.com/goccy/go-json/internal/encoder/string.go b/vendor/github.com/goccy/go-json/internal/encoder/string.go index 26da31a5e..a699dba19 100644 --- a/vendor/github.com/goccy/go-json/internal/encoder/string.go +++ b/vendor/github.com/goccy/go-json/internal/encoder/string.go @@ -405,7 +405,10 @@ func stringToUint64Slice(s string) []uint64 { })) } -func AppendEscapedString(buf []byte, s string) []byte { +func AppendString(ctx *RuntimeContext, buf []byte, s string) []byte { + if ctx.Option.Flag&HTMLEscapeOption == 0 { + return appendString(buf, s) + } valLen := len(s) if valLen == 0 { return append(buf, `""`...) @@ -531,7 +534,7 @@ ESCAPE_END: return append(append(buf, s[i:]...), '"') } -func AppendString(buf []byte, s string) []byte { +func appendString(buf []byte, s string) []byte { valLen := len(s) if valLen == 0 { return append(buf, `""`...) |