mirror of
https://github.com/restic/restic.git
synced 2026-12-04 15:44:46 +00:00
data: call Node.MarshalJSON directly when building a tree
This commit is contained in:
1 parent
33b2785d90
commit
ed922942fc
1 file changed
+3
-1
@@ -302,7 +302,9 @@ func (builder *TreeJSONBuilder) AddNode(node *Node) error {
|
||||
}
|
||||
builder.lastName = node.Name
|
||||
|
||||
val, err := json.Marshal(node)
|
||||
// Call MarshalJSON directly: json.Marshal would only validate and copy its
|
||||
// output, which is already compact.
|
||||
val, err := node.MarshalJSON()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user