mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-08-20 18:33:52 -07:00
diskstats: Simplify condition (#3290)
As the comment says, this can be simplified now. Signed-off-by: Manuel Rüger <manuel@rueg.eu>
This commit is contained in:
parent
e5caa394c8
commit
8804ce1551
|
@ -398,15 +398,9 @@ func getUdevDeviceProperties(major, minor uint32) (udevInfo, error) {
|
||||||
|
|
||||||
line = strings.TrimPrefix(line, udevDevicePropertyPrefix)
|
line = strings.TrimPrefix(line, udevDevicePropertyPrefix)
|
||||||
|
|
||||||
/* TODO: After we drop support for Go 1.17, the condition below can be simplified to:
|
|
||||||
|
|
||||||
if name, value, found := strings.Cut(line, "="); found {
|
if name, value, found := strings.Cut(line, "="); found {
|
||||||
info[name] = value
|
info[name] = value
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
if fields := strings.SplitN(line, "=", 2); len(fields) == 2 {
|
|
||||||
info[fields[0]] = fields[1]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return info, nil
|
return info, nil
|
||||||
|
|
Loading…
Reference in a new issue