API to get process's exit status, plz

exec.Command does a lot of helpful things, but it currently lacks a standard API call for obtaining a process’s exit status. When troubleshooting failing processes, this value often provides important details, and Go should be able to provide this to the programmer.

As tux21b points out, there is a way to hack at this value for Linux processes, but it relies on an internal API call likely to break on different platforms. https://stackoverflow.com/questions/10385551/get-exit-code-go

What we really want is a standard, cross-platform API call for this.

Processes do not have exit statuses on all platforms supported by Go. Getting the exit status using a type assertion is fine.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.