Skip to content

panic on macos when unable to locate ps #10

Open
@akamensky

Description

@akamensky

Still not sure why it has to defer to using PS on macos, this is far from optimal, but I found out that it panics with:

panic: runtime error: index out of range

goroutine 35 [running]:
github.com/struCoder/pidusage.formatStdOut(0x0, 0x0, 0x0, 0x1, 0x1124880, 0xc00000a040, 0x0)
	/Users/username/go/src/github.com/struCoder/pidusage/pidusage.go:62 +0xd8

That is because in my app I needed to restrict PATH to only specific location (and writing/testing it on macos, though supposed to run on Linux later).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions