From 053ba93bc001d32f4fca5a3276f1207f9aa4b52d Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 27 Apr 2026 00:06:50 +0700 Subject: [PATCH] refactor(hierarchy): use maps.Copy for attribute merge Linter flagged the manual loop after recent edits surfaced the hint. --- internal/hierarchy/hierarchy.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/hierarchy/hierarchy.go b/internal/hierarchy/hierarchy.go index 405cd50..56c1511 100644 --- a/internal/hierarchy/hierarchy.go +++ b/internal/hierarchy/hierarchy.go @@ -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) }