Skip to content

Commit 61fe412

Browse files
authored
Fix linting issues (#734)
Fixup linting issues in `sysfs/net_class_ecn.go`. Signed-off-by: SuperQ <[email protected]>
1 parent 61fb25b commit 61fe412

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sysfs/net_class_ecn.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func (fs FS) EcnByIface(devicePath string) (*EcnIface, error) {
135135
}
136136
if !validPath {
137137
// this device doesn't have ECN values at this path
138-
return nil, fmt.Errorf("Does not have ECN values: %q", devicePath)
138+
return nil, fmt.Errorf("does not have ECN values: %q", devicePath)
139139
}
140140

141141
ecnIface, err := ParseEcnIfaceInfo(ecnPath)
@@ -362,11 +362,12 @@ func ParseEcnEnable(path string) (map[uint8]bool, error) {
362362

363363
vp := util.NewValueParser(value)
364364
fileValue := *vp.PUInt64()
365-
if fileValue == 0 {
365+
switch fileValue {
366+
case 0:
366367
ecn[uint8(filenameInt)] = false
367-
} else if fileValue == 1 {
368+
case 1:
368369
ecn[uint8(filenameInt)] = true
369-
} else {
370+
default:
370371
return nil, fmt.Errorf("failed to parse file %q: %q", filename, value)
371372
}
372373
}

0 commit comments

Comments
 (0)