Fix QF1004: could use strings.ReplaceAll instead (staticcheck)

This commit is contained in:
Holger Obermaier
2026-02-04 10:37:22 +01:00
parent 3c03f4ac96
commit c24b3a7e4b
4 changed files with 5 additions and 5 deletions

View File

@@ -1291,8 +1291,8 @@ func (m *NvidiaCollector) Read(interval time.Duration, output chan lp.CCMessage)
if ret == nvml.SUCCESS {
mname, ret := nvml.DeviceGetName(mdev)
if ret == nvml.SUCCESS {
x := strings.Replace(mname, name, "", -1)
x = strings.Replace(x, "MIG", "", -1)
x := strings.ReplaceAll(mname, name, "")
x = strings.ReplaceAll(x, "MIG", "")
x = strings.TrimSpace(x)
migDevice.tags["stype-id"] = x
}