diff --git a/libcontainer/cgroups/getallpids.go b/libcontainer/cgroups/getallpids.go index 09c01fb6f..1355a5101 100644 --- a/libcontainer/cgroups/getallpids.go +++ b/libcontainer/cgroups/getallpids.go @@ -1,6 +1,3 @@ -//go:build go1.16 -// +build go1.16 - package cgroups import ( diff --git a/libcontainer/cgroups/getallpids_go115.go b/libcontainer/cgroups/getallpids_go115.go deleted file mode 100644 index 6b645ef64..000000000 --- a/libcontainer/cgroups/getallpids_go115.go +++ /dev/null @@ -1,31 +0,0 @@ -//go:build !go1.16 -// +build !go1.16 - -package cgroups - -import ( - "os" - "path/filepath" -) - -// GetAllPids returns all pids, that were added to cgroup at path and to all its -// subcgroups. -func GetAllPids(path string) ([]int, error) { - var pids []int - // collect pids from all sub-cgroups - err := filepath.Walk(path, func(p string, info os.FileInfo, iErr error) error { - if iErr != nil { - return iErr - } - if !info.IsDir() { - return nil - } - cPids, err := readProcsFile(p) - if err != nil { - return err - } - pids = append(pids, cPids...) - return nil - }) - return pids, err -}