From 906df3ed85ca1a59e1f74209819874ab42a0b591 Mon Sep 17 00:00:00 2001 From: Nikolay Sivko Date: Fri, 11 Dec 2015 14:47:48 +0300 Subject: [PATCH] [net] fix panic on freebsd (netstat error with exit code 0) --- net/net_freebsd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/net_freebsd.go b/net/net_freebsd.go index 6dc7a23..d6882f1 100644 --- a/net/net_freebsd.go +++ b/net/net_freebsd.go @@ -32,6 +32,9 @@ func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) { } exists = append(exists, values[0]) + if len(values) < 12 { + continue + } base := 1 // sometimes Address is ommitted if len(values) < 13 {