mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
refactor(hierarchy): use maps.Copy for attribute merge
Linter flagged the manual loop after recent edits surfaced the hint.
This commit is contained in:
1 parent
5697dfb0c0
commit
053ba93bc0
1 file changed
+2
-3
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user