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: incorrectly rejects '@' character in directory names #35115

Closed
jayconrod opened this issue Oct 23, 2019 · 5 comments
Closed

cmd/go: incorrectly rejects '@' character in directory names #35115

jayconrod opened this issue Oct 23, 2019 · 5 comments
Assignees
Milestone

Comments

@jayconrod
Copy link
Contributor

@jayconrod jayconrod commented Oct 23, 2019

What version of Go are you using (go version)?

$ go version
go1.13.3

Does this issue reproduce with the latest release?

Reproduces in go1.13.3 but not in go1.13.2 or go1.12.11. This seems to be a regression.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jayconrod/Library/Caches/go-build"
GOENV="/Users/jayconrod/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jayconrod/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/go/installed"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/go/installed/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jayconrod/Code/test/@/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rq/x0692kqj6ml8cvrhcqh5bswc008xj1/T/go-build027955611=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

mkdir @
cd @
go mod init m
echo 'package m' >m.go
go list $(pwd)

What did you expect to see?

Same output as go list .:

m

What did you see instead?

can't load package: package /Users/jayconrod/Code/test@: can only use path@version syntax with 'go get'

The @ character is not valid in module paths or package paths. However, it is allowed in file names. It should certainly be allowed in module parent directory names.

@jayconrod

This comment has been minimized.

Copy link
Contributor Author

@jayconrod jayconrod commented Oct 23, 2019

Caused by CL 194600

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 23, 2019

Change https://golang.org/cl/202761 mentions this issue: cmd/go: ignore '@' when cleaning local and absolute file path args

@jayconrod jayconrod modified the milestones: Go1.13.4, Go1.14 Oct 23, 2019
@jayconrod

This comment has been minimized.

Copy link
Contributor Author

@jayconrod jayconrod commented Oct 23, 2019

@gopherbot Please backport to go1.13

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 23, 2019

Backport issue(s) opened: #35119 (for 1.13).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 23, 2019

Change https://golang.org/cl/202763 mentions this issue: [release-branch.go1.13] cmd/go: ignore '@' when cleaning local and absolute file path args

@gopherbot gopherbot closed this in 7833302 Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.