-
Notifications
You must be signed in to change notification settings - Fork 18k
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: go.mod should have a different name #23972
Comments
My interpretation is that a file extension implies only that there could be more than one file in a directory having the same name modulo the extension as long as the extensions differ. |
Sure. But there can only be one file called module in a directory, but there can be many files with .mod. That’s my point.
… On 21 Feb 2018, at 21:22, cznic ***@***.***> wrote:
The .mod extension implies that there can be a set of .mod files in a module, just as there can be a set of .go files.
My interpretation is that a file extension implies only that there could be more than one file in a directory having the same name modulo the extension as long as the extensions differ.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I agree the name should be changed. Many other projects have suffered similarly with arbitrary project-root files. e.g. Ruby/Bundler recently switched from Since the file is very close to go syntax, it should be understood "I'm looking at a go file", not a special bespoke file (though discussion on the format inside the file is ongoing in #23966). It may be difficult to introduce a default that could conflict with existing filenames in go projects. Maybe a scan of all public go repos would reveal how many collisions there might be with a name like |
Why should there be only one You could do it in Probably I don't know if this idea necessarily has merit, but I don't see why we should make it impossible by removing the file extension. |
That @davecheney and @4ad interpret the the situation so differently indicates a need for some clarification on the intent of the module file. I wonder what @rsc was thinking when he was writing the proposal. The community should make a decision sooner rather than later because it definitely steers the conversation on naming the file. I also think @drewblas' point is worth consideration, depending on how close to Go code the mod file syntax ends up. Reminds me of Python's |
I think the point being made by dave is that the new file extension should try to be universally unique as possible instead of just unique within go. This is a wise choice considering the elimination of path. |
For clarification, my request is that the module file not have an extension, so that there can be only one module file per directory. |
okay, I believe the file should have an extension but that file extension should try to be universally unique at possible. I believe file extensions help things run smoothly in windows. |
@davecheney's argument against go.mod is that using an extension implies that varying the base name is meaningful. A few thoughts. First, as @cznic points out, it could equally well imply that varying the extension is meaningful (go.mod, go.modverify, go.txt, and so on). Second, I can easily see adding an option to the go command Third, I think the file needs some extension. I'm not a fan of extension-less files, especially those suffixed with "file": makefile, dockerfile, etc. The custom extension makes collisions far less likely. The discussion also raised using Go syntax. It's not Go, nor will it become Go. It's meant to be evocative of Go but also obviously different, to avoid confusion. The necessary semantics are different enough from Go that reusing Go itself is not a good fit. The current file format is arguably too close to Go, and I intend to make the quotes optional (and canonically omitted) to distance it a bit more. It's important to me that resolving modules not involve running arbitrary code, as in Going to keep go.mod for now. |
This is unfortunate. Not everyone and not everything is done through a CLI. In windows it is not uncommon for a workflow to be done with point and clicks through gui interaction. The file extension should try to be universally unique as possible. Now there will be inevitable conflicts. |
I'm disappointed that the name I am reopening this issue in the hope that this can be revisited. |
FTR: Here's another thing associated traditionally with the |
It should even be configurable, with a sane default (go.modrc ?) |
@jbrodriguez I can't be configurable; it has to be the same everywhere. |
I'm really sorry, @adg, but it's too late to reopen this. I know about the Amiga mod file format and that it is still used, but file extensions just aren't globally unique (there are already 5 entries for MOD on the Wikipedia list). I apologize for any software that tries to turn go.mod files into music, although I'm curious to hear what that would sound like. |
Hello,
I don't think
go.mod
should be calledgo.mod
, or more specifically anything.mod
.My reason is
.mod
is a file extension. Maybe this was not the intention, but it's my interpretation. The.mod
extension implies that there can be a set of.mod
files in a module, just as there can be a set of.go
files.go.mod
should be renamed to something singular, and i'm going to suggestmodule
as the replacement.The text was updated successfully, but these errors were encountered: