Files
weave-scope/vendor/github.com/weaveworks/procspy/example_test.go
2015-10-24 11:19:50 +01:00

21 lines
313 B
Go

package procspy_test
import (
"fmt"
"github.com/weaveworks/procspy"
)
func Example() {
lookupProcesses := true
cs, err := procspy.Connections(lookupProcesses)
if err != nil {
panic(err)
}
fmt.Printf("TCP Connections:\n")
for c := cs.Next(); c != nil; c = cs.Next() {
fmt.Printf(" - %v\n", c)
}
}