fix lint errors
This commit is contained in:
parent
9e79a36020
commit
ac0f6fcd39
2 changed files with 38 additions and 19 deletions
|
|
@ -64,14 +64,13 @@ func GetCgroupVersion() int64 {
|
|||
// /sys/fs/cgroup/cgroup.controllers will not exist with cgroupsv1
|
||||
if _, err := os.Stat("/sys/fs/cgroup/cgroup.controllers"); err == nil {
|
||||
return 2
|
||||
} else {
|
||||
return 1
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
func readCgroup2FileToInt64Tuple(cgroupFile string) (int64, int64) {
|
||||
contents, err := os.ReadFile(filepath.Join("/sys/fs/cgroup/", cgroupFile))
|
||||
|
||||
func readCgroup2FileToInt64Tuple(cgroupFile string) (quota, period int64) {
|
||||
contents, err := os.ReadFile(filepath.Join(string(os.PathSeparator), "sys", "fs", "cgroup", cgroupFile))
|
||||
if err != nil {
|
||||
return -1, -1
|
||||
}
|
||||
|
|
@ -87,7 +86,6 @@ func readCgroup2FileToInt64Tuple(cgroupFile string) (int64, int64) {
|
|||
}
|
||||
|
||||
cpuQuota, err := strconv.ParseInt(values[0], 10, 64)
|
||||
|
||||
if err != nil {
|
||||
return -1, -1
|
||||
}
|
||||
|
|
@ -97,7 +95,6 @@ func readCgroup2FileToInt64Tuple(cgroupFile string) (int64, int64) {
|
|||
}
|
||||
|
||||
cpuPeriod, err := strconv.ParseInt(values[1], 10, 64)
|
||||
|
||||
if err != nil {
|
||||
return -1, -1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue