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

x/vgo: make quotes optional in go.mod file #24641

rsc opened this issue Apr 2, 2018 · 3 comments


Copy link

commented Apr 2, 2018

Here's a short go.mod:

module ""

require (
	"" v0.0.0-20180208041248-4e4a3210bb54
	"" v1.5.2

I propose to drop the distinction between a quoted string and a bare literal, with the restriction that literals must not include any kind of unicode space, nor U+0022 (") nor U+0060 (`). Then this file can be shortened to (and would be rewritten canonically as):


require ( v0.0.0-20180208041248-4e4a3210bb54 v1.5.2

Not quoting should make it easier to copy and paste from the command line or from substrings of import paths or from "go list -m" output. Backslashes are allowed in literals and stand for themselves, so that you can write

replace v1.5.2 => c:\work\quote

If you need a space in the path in that form then it's still necessary to quote:

replace v1.5.2 => `c:\rsc\my work\quote`
replace v1.5.2 => "/users/rsc/my work/quote"

@rsc rsc added this to the vgo milestone Apr 2, 2018

@rsc rsc added the NeedsFix label Apr 2, 2018


This comment has been minimized.

Copy link

commented Apr 3, 2018

Is => mandatory for replace ? It could be more like require
replace v1.5.2 c:\work\quote

exclude also, i think you propose it also.


This comment has been minimized.

Copy link
Contributor Author

commented Apr 3, 2018

Yes, => is still mandatory for replace. I think replace is confusing enough to be worth having that separator.

@dmitshur dmitshur changed the title vgo: make quotes optional in go.mod file x/vgo: make quotes optional in go.mod file Apr 4, 2018


This comment has been minimized.

Copy link

commented Apr 6, 2018

Change mentions this issue: cmd/go/internal/modfile: allow, prefer unquoted strings in mod files

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