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:
Manuel Rüger 2025-03-31 12:47:22 +02:00 committed by GitHub
parent e5caa394c8
commit 8804ce1551
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -398,15 +398,9 @@ func getUdevDeviceProperties(major, minor uint32) (udevInfo, error) {
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 {
info[name] = value
}
*/
if fields := strings.SplitN(line, "=", 2); len(fields) == 2 {
info[fields[0]] = fields[1]
}
}
return info, nil