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/gc, cmd/go: restrict Import path character set #6547

Closed
msiebuhr opened this issue Oct 8, 2013 · 3 comments
Closed

cmd/gc, cmd/go: restrict Import path character set #6547

msiebuhr opened this issue Oct 8, 2013 · 3 comments

Comments

@msiebuhr
Copy link
Contributor

msiebuhr commented Oct 8, 2013

What steps will reproduce the problem?
1. Running `go get example.com:80/foo`

What is the expected output?
Import paths with illegal characters per http://golang.org/ref/spec#Import_declarations
should fail with a message on the order of

  import path contains invalid character ':': "example.com:80/foo"

(Taken from play.golang.org that does complain about such things.)

What do you see instead?
It tries to import a package with the given name.

Which operating system are you using?
Linux

Which version are you using?  (run 'go version')
go version devel +094fb360be8d Tue Oct 08 16:53:56 2013 +1100 linux/amd64
@adg
Copy link
Contributor

adg commented Oct 8, 2013

Comment 1:

It says "A compiler may restrict ImportPaths", note the "may". It needn't be an error.

Status changed to WorkingAsIntended.

@msiebuhr
Copy link
Contributor Author

msiebuhr commented Oct 8, 2013

Comment 2:

Yes. But it will produce an invalid path on Windows machines, as `:` isn't allowed in
paths on that platform.
https://golang.org/issue/6489?c=2

@adg
Copy link
Contributor

adg commented Oct 8, 2013

Comment 3:

It's one thing to not support a certain case (re 6489) and another to forbid it.
I suppose we could reject such paths, but this would be a backward incompatible change.
It's arguable (tenuously IMO) that the current behavior is a bug, and on those grounds
it could be changed.

Labels changed: added priority-later, removed priority-triage.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
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

3 participants