From f9609a30abef1a578bc30dd9807299b314091a2f Mon Sep 17 00:00:00 2001 From: nikandfor Date: Sat, 10 Aug 2024 11:51:47 +0200 Subject: [PATCH] fix Encode{}.Encode->Append --- fuzz/json_test.go | 2 +- jq/base64.go | 2 +- jq/examples_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fuzz/json_test.go b/fuzz/json_test.go index 7c2be0e..f2b3f4e 100644 --- a/fuzz/json_test.go +++ b/fuzz/json_test.go @@ -68,7 +68,7 @@ func FuzzStringEncodeDecode(f *testing.F) { // t.SkipNow() // } - b := g.EncodeString(nil, s) + b := g.AppendString(nil, s) st := len(b) b, i, err := p.DecodeString(b, 0, b) diff --git a/jq/base64.go b/jq/base64.go index 93ddcb6..4325767 100644 --- a/jq/base64.go +++ b/jq/base64.go @@ -71,7 +71,7 @@ func base64Apply(w, r []byte, st int, e *base64.Encoding, enc bool, buf []byte) return w, s, i, err } - w = (&json.Encoder{}).EncodeString(w, s[ssize:ssize+n]) + w = (&json.Encoder{}).AppendString(w, s[ssize:ssize+n]) } return w, s, i, nil diff --git a/jq/examples_test.go b/jq/examples_test.go index 3675d6b..96c281d 100644 --- a/jq/examples_test.go +++ b/jq/examples_test.go @@ -24,7 +24,7 @@ func ExampleIndex() { fmt.Printf("value: %s\n", res) fmt.Printf("final position: %d of %d\n", i, len(data)) // filter only parsed first value in the buffer - _ = i < len(data) // and stopped immideately after it + _ = i < len(data) // and stopped immediately after it // Output: // value: {"obj":"val"}