summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-25 23:11:06 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-25 23:20:18 -0700
commite483afa206686ce748ad270140f99fad9d713aad (patch)
tree2f65755ece7059579e902132cf0e44cb0fbbb0d6 /compat
parentf834aaeb56b929ed06e0545a589b7dd82b4602d3 (diff)
Delete things I don't want to document
Diffstat (limited to 'compat')
-rw-r--r--compat/json/compat.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/compat/json/compat.go b/compat/json/compat.go
index fc693f8..f8b23e3 100644
--- a/compat/json/compat.go
+++ b/compat/json/compat.go
@@ -50,7 +50,7 @@ func convertEncodeError(err error) error {
func marshal(v any, formatter *lowmemjson.ReEncoder) ([]byte, error) {
var buf bytes.Buffer
formatter.Out = &buf
- if err := convertEncodeError(lowmemjson.Encode(formatter, v)); err != nil {
+ if err := convertEncodeError(lowmemjson.NewEncoder(formatter).Encode(v)); err != nil {
return nil, err
}
return buf.Bytes(), nil
@@ -213,7 +213,7 @@ func convertDecodeError(err error) error {
}
func Unmarshal(data []byte, ptr any) error {
- return convertDecodeError(lowmemjson.DecodeThenEOF(bytes.NewReader(data), ptr))
+ return convertDecodeError(lowmemjson.NewDecoder(bytes.NewReader(data)).DecodeThenEOF(ptr))
}
type Decoder struct {