Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get all processes info build error #29

Open
tobor opened this issue Oct 6, 2015 · 1 comment
Open

Get all processes info build error #29

tobor opened this issue Oct 6, 2015 · 1 comment

Comments

@tobor
Copy link

tobor commented Oct 6, 2015

func main() {
stat, err := linuxproc.ReadStat("/proc/stat")
Checkerr(err)
for _, s := range stat.Processes {
fmt.Println(s.Status.pid, s.Status.name, s.Cmdline)
}
}

cannot range over stat.Processes (type uint64)

@bgammill
Copy link

stat.Processes is type uint64, so you're trying to range over a type that is not iterable. You can only iterate over a few types with goprocinfo. Try ranging over stat.CPUStats instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants