I am trying to get the results of top (more specifically htop) but every
time it prints nothing, whereas any other command (ls, pwd, etc...) returns
the output fine. My objective is to get access to the process stats that
are returned to the screen.
Here is the latest example which displays nothing:
package main
import (
"fmt"
"github.com/go-cmd/cmd"
)
func main() {
// Create Cmd, buffered output
envCmd := cmd.NewCmd("htop")
// Run and wait for Cmd to return Status
status := <-envCmd.Start()
// Print each line of STDOUT from Cmd
for _, line := range status.Stdout {
fmt.Println(line)
}
}
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/CAHr9bgaiOL%3DcZy2rgVv4F2y1CUpE1ovRRmuS1gDD1WwipNoswQ%40mail.gmail.com.