Turn on More linters

- misspell
    - prealloc
    - unparam
    - nakedret

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2020-06-11 14:40:38 -04:00
parent 3f026eb6a6
commit 200cfa41a4
74 changed files with 296 additions and 435 deletions

View File

@ -133,7 +133,7 @@ func getAvailableControllers(exclude map[string]controllerHandler, cgroup2 bool)
if err != nil {
return nil, errors.Wrapf(err, "read directory %s", cgroupRoot)
}
var controllers []controller
controllers := []controller{}
for _, i := range infos {
name := i.Name()
if _, found := exclude[name]; found {
@ -505,7 +505,7 @@ func (c *CgroupControl) AddPid(pid int) error {
return nil
}
var names []string
names := make([]string, 0, len(handlers))
for n := range handlers {
names = append(names, n)
}