You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=(private)
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=(private)
set GOPROXY=
set GORACE=
set GOROOT=(private)
set GOTMPDIR=
set GOTOOLDIR=(private)
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=(private)=/tmp/go-build -gno-record-gcc-switches
What did you do?
When passing quotes (properly escaped) as arguments, Go doesn't restitue them in os.Args.
Go seems to be interpreting the quotes in lieu of the shell (PowerShell here).
Example:
package main
import (
"fmt""os"
)
funcmain() {
fmt.Println(os.Args[1])
}
I'm fairly sure Go on windows goes to extensive lengths to mimic how windows internally parses arguments. Doing a test right now even windows isn't consistent. On powershell I got similar results as above, but on windows cmd I get different results.
I believe most of windows uses the same argument parser the cmd terminal demonstrates.
What you are finding is a limitation of the design in windows itself. Yes, Go is interpreting the arguments. That's how windows works.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
When passing quotes (properly escaped) as arguments, Go doesn't restitue them in os.Args.
Go seems to be interpreting the quotes in lieu of the shell (PowerShell here).
Example:
(Or with a single quote:
)
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: