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/compile: "import path contains space character" for imports without spaces #20306

Closed
griesemer opened this issue May 9, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@griesemer
Copy link
Contributor

commented May 9, 2017

cmd/compile complains if an import path contains a space character. More so, it also complains if a package path (import path after resolving it) contains a space character. This seems overly zealous.

For instance, for a small experiment, I had put two .go files main.go and lib.go in a local directory that happens to be under my Google Drive directory, with the main package containing the local import "./lib". Because this resolves to an absolute path containing "Google Drive" as a component, the import gets rejected.

It's probably useful to reject arbitrary Unicode spaces, but a regular blank ' ' (0x20) character should be ok. Independent of Google Drive, on OS X it is not uncommon to have blanks in folder names.

@robpike

This comment has been minimized.

Copy link
Contributor

commented May 10, 2017

The spec forbids the import path containing a space and I don't think that should change. What you're asking for is the fully-qualified path name to be allowed to have spaces, and that seems fine.

@griesemer

This comment has been minimized.

Copy link
Contributor Author

commented May 10, 2017

@robpike Yes, that is what I am asking for.

@rsc rsc changed the title cmd/compile: "import path contains space character" overly zealous cmd/compile: "import path contains space character" for imports without spaces May 22, 2017

@rsc

This comment has been minimized.

Copy link
Contributor

commented May 22, 2017

Fixing this (but still disallowing actual imports with actual spaces) seems fine.

@rsc rsc added the NeedsFix label May 22, 2017

@griesemer griesemer self-assigned this May 22, 2017

@griesemer griesemer added this to the Go1.9Maybe milestone May 22, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Jun 16, 2017

CL https://golang.org/cl/46001 mentions this issue.

@griesemer griesemer modified the milestones: Go1.9, Go1.9Maybe Jun 16, 2017

@gopherbot gopherbot closed this in 6c2458e Jun 19, 2017

@golang golang locked and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.