refactor(hierarchy): use maps.Copy for attribute merge

Linter flagged the manual loop after recent edits surfaced the hint.
This commit is contained in:
pj committed 2026-04-27 00:06:50 +07:00
1 parent 5697dfb0c0
commit 053ba93bc0
1 file changed
+2 -3
+2 -3
View File
@@ -26,6 +26,7 @@ package hierarchy
import (
"encoding/json"
"fmt"
"maps"
"regexp"
"strconv"
"strings"
@@ -229,9 +230,7 @@ func elementFromNode(node *treeNodeJSON) *Element {
}
element.Attributes = make(map[string]string, len(attrs)+5)
for k, v := range attrs {
element.Attributes[k] = v
}
maps.Copy(element.Attributes, attrs)
if node.Clickable != nil {
element.Attributes["clickable"] = strconv.FormatBool(*node.Clickable)
}