refactor: use maps.Copy from stdlib
This commit is contained in:
@@ -2,6 +2,7 @@ package observability
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"maps"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
@@ -220,9 +221,7 @@ func buildLabelKey(labelNames []string, labelValues []string) (string, map[strin
|
|||||||
|
|
||||||
func copyLabels(labels map[string]string) map[string]string {
|
func copyLabels(labels map[string]string) map[string]string {
|
||||||
out := make(map[string]string, len(labels))
|
out := make(map[string]string, len(labels))
|
||||||
for key, value := range labels {
|
maps.Copy(out, labels)
|
||||||
out[key] = value
|
|
||||||
}
|
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user