Don't know if this is easier, agree no present way is easy enough, but this 
worked for one project I was working on:

cmd := exec.Command("zfs", "get", "all")
_ = cmd.Run() // shamelessly discard any error
exitcode := cmd.ProcessState.Sys().(syscall.WaitStatus).ExitStatus()
if exitcode != 0 {
   whatever...
}

Bucky

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to