summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/btrfs-rec/util.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/btrfs-rec/util.go b/cmd/btrfs-rec/util.go
index b2497b2..3c72cae 100644
--- a/cmd/btrfs-rec/util.go
+++ b/cmd/btrfs-rec/util.go
@@ -31,7 +31,7 @@ func readJSONFile[T any](ctx context.Context, filename string) (T, error) {
return zero, err
}
var ret T
- if err := lowmemjson.DecodeThenEOF(buf, &ret); err != nil {
+ if err := lowmemjson.NewDecoder(buf).DecodeThenEOF(&ret); err != nil {
var zero T
return zero, err
}
@@ -46,5 +46,5 @@ func writeJSONFile(w io.Writer, obj any, cfg lowmemjson.ReEncoder) (err error) {
}
}()
cfg.Out = buffer
- return lowmemjson.Encode(&cfg, obj)
+ return lowmemjson.NewEncoder(&cfg).Encode(obj)
}