Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/exec: Doesn't properly report exit code of a "is not recognized as an internal or external command" command #7850

Closed
gopherbot opened this issue Apr 23, 2014 · 2 comments
Milestone

Comments

@gopherbot
Copy link
Contributor

by Kusold:

What does 'go version' print? 1.2.1 windows/amd64

On Windows, run the attached .go file. The exitcode that is reported is a "1".
However when you run the attached .bat file, you will see that Windows reports this
error as a 9009.


What happened?
The exitcode that Go is reporting is "1".
The exitcode that Windows is reporting is 9009.

What should have happened instead?
Go should report 9009

Attachments:

  1. testGoCmdWindows.go (178 bytes)
  2. testWindowsExitCode.bat (23 bytes)
@ianlancetaylor
Copy link
Member

Comment 1:

Labels changed: added repo-main, release-go1.4, os-windows.

@alexbrainman
Copy link
Member

Comment 2:

Your two programs (.go and .bat) are not the same. I've changed your .bat file to match
what .go program does, and now it (.bat program) reports the same error:
C:\a>type testWindowsExitCode.bat
cmd /C foo
echo %ERRORLEVEL%
C:\a>testWindowsExitCode.bat
C:\a>cmd /C foo
'foo' is not recognized as an internal or external command,
operable program or batch file.
C:\a>echo 1
1
Alex

Status changed to Invalid.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants