fix(hermes): This localized change reduces parseUSBScratchFstab's cognitive complexity by two, from 17 to the allowed 15, without changing source parsing behavior. (incident sonar/metis/go:S3776/AZ2z_XbbKy9i4pkIqvM9)
This commit is contained in:
parent
d7a1dc0b74
commit
c6afc7a3b2
@ -157,12 +157,8 @@ func parseUSBScratchFstab(raw string) (*usbScratchConfig, bool) {
|
|||||||
}
|
}
|
||||||
cfg.Mountpoint = target
|
cfg.Mountpoint = target
|
||||||
cfg.FS = fsType
|
cfg.FS = fsType
|
||||||
if value, ok := strings.CutPrefix(source, "UUID="); ok {
|
cfg.UUID, _ = strings.CutPrefix(source, "UUID=")
|
||||||
cfg.UUID = value
|
cfg.Label, _ = strings.CutPrefix(source, "LABEL=")
|
||||||
}
|
|
||||||
if value, ok := strings.CutPrefix(source, "LABEL="); ok {
|
|
||||||
cfg.Label = value
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if cfg.Mountpoint == "" {
|
if cfg.Mountpoint == "" {
|
||||||
return nil, false
|
return nil, false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user