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: disallowed path element "aux.go" on go get #29589
Comments
I can reproduce on tip. Looks like this is on purpose:
I'm not sure if we could make the error better without leaking too much internal detail. /cc @bcmills |
Clearly we should improve the error message. It's right there in cmd/go/internal/module/module.go: for _, bad := range badWindowsNames {
if strings.EqualFold(bad, short) {
return fmt.Errorf("disallowed path element %q", elem)
}
} Any suggestions for what we should say? |
Since "malformed file path" is already part of the error message, I think "reserved file path "aux"" might be clearer. So - |
Thanks. I sort of feel that we should mention Windows somehow. |
How about:
I'd personally say "some systems" instead of "Windows" so we can later add more reserved names on other systems without introducing more error formats. |
The variable name says badwindowsnames so we can say windows not just some systems However this still misses the key part, that 'aux' word is reserved not aux.go as a whole How about this? malformed file path "aux.go": file name part "aux" is reserved on windows |
I would prefer that we mention Windows explicitly. Some context will probably help folks feel less confused about why an otherwise-reasonable-looking name is disallowed. We can wordsmith the exact text in the code review. |
Change https://golang.org/cl/156658 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.11.4 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tki/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tki/go"
GOPROXY=""
GORACE=""
GOROOT="/snap/go/3095"
GOTMPDIR=""
GOTOOLDIR="/snap/go/3095/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/tki/src/gitlab.com/tkiraly/auxtest/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build672569542=/tmp/go-build -gno-record-gcc-switches"
What did you do?
go get gitlab.com/tkiraly/auxtest
in a directory where there is another project with go.modWhat did you expect to see?
i expected to download the module as a dependency
What did you see instead?
go: finding gitlab.com/tkiraly/auxtest latest
go: downloading gitlab.com/tkiraly/auxtest v0.0.0-20190106140156-e164048c9957
-> unzip /home/tki/go/pkg/mod/cache/download/gitlab.com/tkiraly/auxtest/@v/v0.0.0-20190106140156-e164048c9957.zip: malformed file path "aux.go": disallowed path element "aux.go"
go get: no install location for directory outside GOPATH
For more details see: 'go help gopath'
after renaming the file, the error disappear. aux is a reserved file name??
The text was updated successfully, but these errors were encountered: