code: func CmdExitCodeFromError(err error) (int, error) {
  	cmdExitCode := 0
  	if err != nil {
  		if exitError, ok := err.(*exec.ExitError); ok {
  			waitStatus, ok := exitError.Sys().(syscall.WaitStatus)
  			if !ok {
  				return 1, errors.New("Failed to cast exit status")
  			}
  			cmdExitCode = waitStatus.ExitStatus()
  		}
  		return cmdExitCode, nil
  	}
  	return 0, nil
  }
docs: // CmdExitCodeFromError ...