Avoid staticcheck warning: unnecessary assignment to the blank identifier

This commit is contained in:
Holger Obermaier 2022-01-21 15:20:53 +01:00
parent 5dd2af4e8f
commit 25b9268b24

View File

@ -152,7 +152,7 @@ func (m *LikwidCollector) Init(config []byte) error {
C.free(unsafe.Pointer(cstr)) C.free(unsafe.Pointer(cstr))
m.results[i] = make(map[int]map[string]interface{}) m.results[i] = make(map[int]map[string]interface{})
m.mresults[i] = make(map[int]map[string]float64) m.mresults[i] = make(map[int]map[string]float64)
for tid, _ := range m.cpulist { for tid := range m.cpulist {
m.results[i][tid] = make(map[string]interface{}) m.results[i][tid] = make(map[string]interface{})
m.mresults[i][tid] = make(map[string]float64) m.mresults[i][tid] = make(map[string]float64)
m.gmresults[tid] = make(map[string]float64) m.gmresults[tid] = make(map[string]float64)
@ -194,7 +194,7 @@ func (m *LikwidCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
continue continue
} }
var eidx C.int var eidx C.int
for tid, _ := range m.cpulist { for tid := range m.cpulist {
for eidx = 0; int(eidx) < len(evset.Events); eidx++ { for eidx = 0; int(eidx) < len(evset.Events); eidx++ {
ctr := C.perfmon_getCounterName(gid, eidx) ctr := C.perfmon_getCounterName(gid, eidx)
gctr := C.GoString(ctr) gctr := C.GoString(ctr)
@ -220,7 +220,7 @@ func (m *LikwidCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
} }
for _, metric := range m.config.Metrics { for _, metric := range m.config.Metrics {
for tid, _ := range m.cpulist { for tid := range m.cpulist {
var params map[string]interface{} var params map[string]interface{}
expression, err := govaluate.NewEvaluableExpression(metric.Calc) expression, err := govaluate.NewEvaluableExpression(metric.Calc)
if err != nil { if err != nil {
@ -228,7 +228,7 @@ func (m *LikwidCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
continue continue
} }
params = make(map[string]interface{}) params = make(map[string]interface{})
for j, _ := range m.groups { for j := range m.groups {
for mname, mres := range m.mresults[j][tid] { for mname, mres := range m.mresults[j][tid] {
params[mname] = mres params[mname] = mres
} }
@ -241,7 +241,7 @@ func (m *LikwidCollector) Read(interval time.Duration, out *[]lp.MutableMetric)
m.gmresults[tid][metric.Name] = float64(result.(float64)) m.gmresults[tid][metric.Name] = float64(result.(float64))
} }
} }
for i, _ := range m.groups { for i := range m.groups {
evset := m.config.Eventsets[i] evset := m.config.Eventsets[i]
for _, metric := range evset.Metrics { for _, metric := range evset.Metrics {
_, skip := stringArrayContains(m.config.ExcludeMetrics, metric.Name) _, skip := stringArrayContains(m.config.ExcludeMetrics, metric.Name)