mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: resolve nlreturn linter issues
nlreturn linter requires a new line before return and branch statements except when the return is alone inside a statement group (such as an if statement) to increase code clarity. This commit addresses such issues. Updates: #1586 Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
@ -53,6 +53,7 @@ func getCgroupPidsFile() (string, error) {
|
||||
}
|
||||
if parts[1] == "pids" {
|
||||
slice = parts[2]
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -61,6 +62,7 @@ func getCgroupPidsFile() (string, error) {
|
||||
}
|
||||
|
||||
pidsMax := fmt.Sprintf(sysPidsMaxFmt, slice)
|
||||
|
||||
return pidsMax, nil
|
||||
}
|
||||
|
||||
@ -91,6 +93,7 @@ func GetPIDLimit() (int, error) {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
|
||||
return maxPids, nil
|
||||
}
|
||||
|
||||
@ -115,6 +118,7 @@ func SetPIDLimit(limit int) error {
|
||||
_, err = f.WriteString(limitStr)
|
||||
if err != nil {
|
||||
f.Close() // #nosec: a write error will be more useful to return
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user