mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2026-02-13 06:31:46 +01:00
Fix QF1003: could use tagged switch on ... (staticcheck)
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user