Skip to content

Commit

Permalink
fix Encode{}.Encode->Append
Browse files Browse the repository at this point in the history
  • Loading branch information
nikandfor committed Aug 10, 2024
1 parent a4b09cb commit f9609a3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fuzz/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jq/base64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion jq/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit f9609a3

Please sign in to comment.