deputy
                                
                                 deputy copied to clipboard
                                
                                    deputy copied to clipboard
                            
                            
                            
                        Get the exit code
Hi,
Is there a way to get the exit code of the called process ? Thank you
I could add that code, definitely. Barring that, you can do it yourself:
type exitStatus interface {
	ExitStatus() int
}
// ExitStatus returns the exit status of the error if it is an exec.ExitError
// or if it implements ExitStatus() int.
// 0 if it is nil or 1 if it is a different error.
func ExitStatus(err error) int {
	if err == nil {
		return 0
	}
	if e, ok := err.(exitStatus); ok {
		return e.ExitStatus()
	}
	if e, ok := err.(*exec.ExitError); ok {
		if ex, ok := e.Sys().(exitStatus); ok {
			return ex.ExitStatus()
		}
	}
	return 1
}