Fix QF1003: could use tagged switch on ... (staticcheck)

This commit is contained in:
Holger Obermaier
2026-02-04 10:56:17 +01:00
parent 12ab80ccad
commit faf5088385
3 changed files with 10 additions and 8 deletions

View File

@@ -118,13 +118,14 @@ func (m *IpmiCollector) readIpmiTool(cmd string, output chan lp.CCMessage) {
if err == nil {
name := strings.ToLower(strings.ReplaceAll(strings.TrimSpace(lv[0]), " ", "_"))
unit := strings.TrimSpace(lv[2])
if unit == "Volts" {
switch unit {
case "Volts":
unit = "Volts"
} else if unit == "degrees C" {
case "degrees C":
unit = "degC"
} else if unit == "degrees F" {
case "degrees F":
unit = "degF"
} else if unit == "Watts" {
case "Watts":
unit = "Watts"
}