Fix: interface{} can be replaced by any

Fix: Replace m[k]=v loop with maps.Copy
This commit is contained in:
Holger Obermaier
2026-02-10 13:04:39 +01:00
parent 9868772cba
commit f1e5e3374a
28 changed files with 177 additions and 186 deletions

View File

@@ -10,6 +10,7 @@ package metricRouter
import (
"encoding/json"
"fmt"
"maps"
"os"
"strings"
"sync"
@@ -192,8 +193,8 @@ func (r *metricRouter) Init(ticker mct.MultiChanTicker, wg *sync.WaitGroup, rout
return nil
}
func getParamMap(point lp.CCMessage) map[string]interface{} {
params := make(map[string]interface{})
func getParamMap(point lp.CCMessage) map[string]any {
params := make(map[string]any)
params["metric"] = point
params["name"] = point.Name()
for key, value := range point.Tags() {
@@ -202,9 +203,7 @@ func getParamMap(point lp.CCMessage) map[string]interface{} {
for key, value := range point.Meta() {
params[key] = value
}
for key, value := range point.Fields() {
params[key] = value
}
maps.Copy(params, point.Fields())
params["timestamp"] = point.Time()
return params
}