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: flags ending with "=." is not correctly parsed by go tool when run via powershell #43179
Comments
The error message you're getting from Compare on Linux:
(Note the extra space after @maruel, can you confirm that the command line you tested with does not contain any Unicode whitespace after the If you run the program in https://play.golang.org/p/CknqiPUEKR9 using |
The same string Your comment made me realize that this works on powershell:
So Here's the confirmation: And your suspicion is right. Powershell:
cmd:
So it looks like it's a parsing bug somewhere in the intersection of go and powershell but I can only confirm with a argument ending with "=.". I'm not familiar enough with powershell to know where the bug is located. That seem surprising to me that nobody used any form of -foo=. in go with powershell yet and would have not noticed the problem.
|
@4a6f656c @alexbrainman @networkimprov @mattn and any other folks who may know things about PowerShell: is it expected that |
I think it's this bug in powershell PowerShell/PowerShell#6291 |
Thanks Sean, that's it. I confirmed that it works with the compiled program @bcmills noted above, not just via "go ...". And confirmed that -foo.bar is split up as "-foo" and ".bar". "=" is not needed. Since it's truly a bug in powershell, we can close this one as there is no AI. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. Reproduces on go1.13.0 too so it's been like that for a while.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Tested https://github.com/maruel/go-bench-recursive-bug at commit maruel/go-bench-recursive-bug@4b4c223
The tree looks like:
There is no .go file in the directory containing go.mod. The test files do not contain a benchmark.
See github action at https://github.com/maruel/go-bench-recursive-bug/blob/4b4c22328a366372765134a10c77900a48605d6a/.github/workflows/test.yml#L56. When shell is not set, it defaults to powershell on Windows. I reproduce locally so it is not github specific.
Here's an example test run to save you from testing locally: https://github.com/maruel/go-bench-recursive-bug/actions/runs/421285187
Ignore the ".\..." I was just experimenting.
What did you expect to see?
In macOS, linux, Windows 10 on cmd:
What did you see instead?
Windows 10 in powershell only:
The text was updated successfully, but these errors were encountered: