Simplify by using GetFromPid

This commit is contained in:
Bryan Boreham committed 2016-03-01 12:12:46 -08:00
1 parent adf56d316d
commit dd74bb1774
1 file changed
+1 -2
+1 -2
View File
@@ -1,7 +1,6 @@
package common
import (
"fmt"
"github.com/vishvananda/netlink"
"github.com/vishvananda/netns"
"net"
@@ -52,7 +51,7 @@ type NetDev struct {
func FindNetDevs(processID int, match func(string) bool) ([]NetDev, error) {
var netDevs []NetDev
ns, err := netns.GetFromPath(fmt.Sprintf("/proc/%d/ns/net", processID))
ns, err := netns.GetFromPid(processID)
if err != nil {
return nil, err
}