Update code to use pault.ag/go/sniff package (#5038)
* Update code to use pault.ag/go/sniff package * Update go dependencies
This commit is contained in:
parent
3e2bbbed3d
commit
d0423c6d4f
17 changed files with 213 additions and 59 deletions
2
vendor/github.com/mitchellh/go-ps/README.md
generated
vendored
2
vendor/github.com/mitchellh/go-ps/README.md
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
# Process List Library for Go
|
||||
# Process List Library for Go [](https://godoc.org/github.com/mitchellh/go-ps)
|
||||
|
||||
go-ps is a library for Go that implements OS-specific APIs to list and
|
||||
manipulate processes in a platform-safe way. The library can find and
|
||||
|
|
|
|||
3
vendor/github.com/mitchellh/go-ps/go.mod
generated
vendored
Normal file
3
vendor/github.com/mitchellh/go-ps/go.mod
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module github.com/mitchellh/go-ps
|
||||
|
||||
go 1.13
|
||||
2
vendor/github.com/mitchellh/go-ps/process_freebsd.go
generated
vendored
2
vendor/github.com/mitchellh/go-ps/process_freebsd.go
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
// +build freebsd,amd64
|
||||
// +build freebsd
|
||||
|
||||
package ps
|
||||
|
||||
|
|
|
|||
10
vendor/github.com/mitchellh/go-ps/process_unix.go
generated
vendored
10
vendor/github.com/mitchellh/go-ps/process_unix.go
generated
vendored
|
|
@ -56,7 +56,7 @@ func processes() ([]Process, error) {
|
|||
|
||||
results := make([]Process, 0, 50)
|
||||
for {
|
||||
fis, err := d.Readdir(10)
|
||||
names, err := d.Readdirnames(10)
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
|
|
@ -64,14 +64,8 @@ func processes() ([]Process, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
for _, fi := range fis {
|
||||
// We only care about directories, since all pids are dirs
|
||||
if !fi.IsDir() {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, name := range names {
|
||||
// We only care if the name starts with a numeric
|
||||
name := fi.Name()
|
||||
if name[0] < '0' || name[0] > '9' {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue