diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-26 01:08:22 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-30 22:15:05 -0700 |
commit | f4f062d7d4ed730411e04ecd36ee36387e50739c (patch) | |
tree | e7db2234e4848ac14d366b2a975ac16d5ef61aa5 /cmd/btrfs-rec | |
parent | 34ca09cddd36c91351ad49b428f9911c6f6ba0ff (diff) |
Upgrade to lowmemjson v0.2.0
Diffstat (limited to 'cmd/btrfs-rec')
-rw-r--r-- | cmd/btrfs-rec/util.go | 4 |
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) } |