mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-27 01:01:44 +00:00
21 lines
313 B
Go
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)
|
|
}
|
|
}
|