data: call Node.MarshalJSON directly when building a tree

This commit is contained in:
g4lb committed 2026-12-02 10:22:25 +02:00
1 parent 33b2785d90
commit ed922942fc
1 file changed
+3 -1
+3 -1
View File
@@ -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
}