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

cmd/go: PowerShell: Flag silently removes file ending when not between parentheses #12909

Closed
RitchieFlick opened this issue Oct 12, 2015 · 4 comments

Comments

@RitchieFlick
Copy link

go version go1.5.1 windows/amd64

This occurred on Windows 8.1 - Powershell, not sure if the problem also exists on Unix systems.

If you pass command line flags to your go executable which contains a file name, without putting it between parentheses, go silently drops the file ending.

Example:

.\myprog.exe -publicKey=test-key.pub

In the program, the variable was set to test-key and not test-key.pub.

Go should at least fail and not silently drop the file extension.

(Tried hours finding a bug in my code which alas wasn't there)

Edit 1:

There was a file test-key in the directory, so that's why my program didn't fail itself.

Edit 2:

As it seems to be a PowerShell specific problem, here the version I'm running:

Major Minor Build Revision
4 0 -1 -1

@cznic
Copy link
Contributor

cznic commented Oct 12, 2015

Can you reproduce the behavior without Powershell involved? Ie. in the plain terminal (I think that's cmd.exe.)

@RitchieFlick
Copy link
Author

I indeed can't reproduce this error with cmd.exe so it seems it's a PowerShell specific problem.

@RitchieFlick RitchieFlick changed the title cmd/go: Flag silently removes file ending when not between parentheses cmd/go: PowerShell: Flag silently removes file ending when not between parentheses Oct 12, 2015
@cznic
Copy link
Contributor

cznic commented Oct 12, 2015

I indeed can't reproduce this error with cmd.exe so it seems it's a PowerShell specific problem.

I'm afraid it's a problem that probably cannot be solved on the Go project side.

@ianlancetaylor
Copy link
Contributor

It sounds like there is nothing for the Go project to do, so closing. If you disagree, please reopen and explain what we should do. Thanks.

@golang golang locked and limited conversation to collaborators Oct 12, 2016
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