Avoid staticcheck warning: unnecessary assignment to the blank identifier

This commit is contained in:
Holger Obermaier 2022-01-21 15:27:18 +01:00
parent 699f69ff59
commit a7f7422ebe

View File

@ -167,7 +167,7 @@ func (m *LikwidCollector) Init(config json.RawMessage) error {
C.free(unsafe.Pointer(cstr))
m.results[i] = make(map[int]map[string]interface{})
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.mresults[i][tid] = make(map[string]float64)
m.gmresults[tid] = make(map[string]float64)
@ -209,7 +209,7 @@ func (m *LikwidCollector) Read(interval time.Duration, output chan lp.CCMetric)
continue
}
var eidx C.int
for tid, _ := range m.cpulist {
for tid := range m.cpulist {
for eidx = 0; int(eidx) < len(evset.Events); eidx++ {
ctr := C.perfmon_getCounterName(gid, eidx)
gctr := C.GoString(ctr)
@ -235,7 +235,7 @@ func (m *LikwidCollector) Read(interval time.Duration, output chan lp.CCMetric)
}
for _, metric := range m.config.Metrics {
for tid, _ := range m.cpulist {
for tid := range m.cpulist {
var params map[string]interface{}
expression, err := govaluate.NewEvaluableExpression(metric.Calc)
if err != nil {
@ -243,7 +243,7 @@ func (m *LikwidCollector) Read(interval time.Duration, output chan lp.CCMetric)
continue
}
params = make(map[string]interface{})
for j, _ := range m.groups {
for j := range m.groups {
for mname, mres := range m.mresults[j][tid] {
params[mname] = mres
}
@ -256,7 +256,7 @@ func (m *LikwidCollector) Read(interval time.Duration, output chan lp.CCMetric)
m.gmresults[tid][metric.Name] = float64(result.(float64))
}
}
for i, _ := range m.groups {
for i := range m.groups {
evset := m.config.Eventsets[i]
for _, metric := range evset.Metrics {
_, skip := stringArrayContains(m.config.ExcludeMetrics, metric.Name)