type ProcFS … func containerNameFromProcCgroup(content string) (string, error) { … } // GetFullContainerName gets the container name given the root process id of the container. // E.g. if the devices cgroup for the container is stored in /sys/fs/cgroup/devices/docker/nginx, // return docker/nginx. Assumes that the process is part of exactly one cgroup hierarchy. func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) { … } // PKill finds process(es) using a regular expression and send a specified // signal to each process. func PKill(name string, sig syscall.Signal) error { … } // PidOf finds process(es) with a specified name (regexp match) // and return their pid(s). func PidOf(name string) ([]int, error) { … } func getPids(re *regexp.Regexp) []int { … }