diff --git a/netns_linux.go b/netns_linux.go index 7162b86..a267c71 100644 --- a/netns_linux.go +++ b/netns_linux.go @@ -138,7 +138,9 @@ func getThisCgroup(cgroupType string) (string, error) { return "", fmt.Errorf("docker pid not found in /var/run/docker.pid") } pid, err := strconv.Atoi(result[0]) - + if err != nil { + return "", err + } output, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cgroup", pid)) if err != nil { return "", err