Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Process List Library for Go
# Process List Library for Go [![GoDoc](https://godoc.org/github.com/mitchellh/go-ps?status.png)](https://godoc.org/github.com/mitchellh/go-ps)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would also need to change these urls?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the README could be replaced completely and detail the purpose of this fork?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that sounds like a good idea. Or just a more high up


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
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/goss-org/go-ps

go 1.13
2 changes: 1 addition & 1 deletion process_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build freebsd,amd64
// +build freebsd

package ps

Expand Down
10 changes: 2 additions & 8 deletions process_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,16 @@ 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
}
if err != nil {
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
}
Expand Down