Skip to content

cmd/go: modules don't support url encoded spaces #45930

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

Closed
damienfamed75 opened this issue May 3, 2021 · 1 comment
Closed

cmd/go: modules don't support url encoded spaces #45930

damienfamed75 opened this issue May 3, 2021 · 1 comment

Comments

@damienfamed75
Copy link

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

$ go version
go version go1.16.1 windows/amd64

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

What did you do?

Go modules do not support the % symbol to be used in the import URL. This can appear when companies use spaces in their project names in Azure DevOps or some other git providers.

Yes, I know it's silly to have a space character, but it does happen and can make %20 in the URL unavoidable without making a new project and sometimes that's not possible.

This is already a pre-existing issue #45549

What did you expect to see?

I expected the module name to work.

What did you see instead?

malformed import path "dev.azure.com/abc/abc%20def/_git/repo-name" invalid character '%'

What could be done

Having % symbols can be quite ugly in an import in the first place. Perhaps an exception can be made for the %20 character and can be automatically aliased as a space character when using it in the code itself.

For instance if I have dev.azure.com/abc/abc%20def/_git/repo-name and I import it I could put:
import "dev.azure.com/abc/abc def/_git/repo-name"

Either way I think it's important for modules to support %20

@seankhliao
Copy link
Member

Duplicate of #41540

@seankhliao seankhliao marked this as a duplicate of #41540 May 3, 2021
@golang golang locked and limited conversation to collaborators May 3, 2022
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