summaryrefslogtreecommitdiff
path: root/pkg/cgroups/cgroups.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/cgroups/cgroups.go')
-rw-r--r--pkg/cgroups/cgroups.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go
index 3b56f944f..399072108 100644
--- a/pkg/cgroups/cgroups.go
+++ b/pkg/cgroups/cgroups.go
@@ -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)
}