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/go: reject unenforced 'go' versions (older than 1.6) in 'go.mod' files #36319
Comments
(It doesn't really depend on Go 1.11 but that's when modules were added; see golang/go#36319)
A related issue is #30791. Also see #30791 (comment) specifically. |
https://golang.org/cl/210799 should describe this in more detail.
|
I believe that the compiler itself only cares about versions back to 1.8 anyway. The compiler doesn't track features added before 1.9, so it can't enforce language changes from before that point. (There were non-trivial language changes in 1.1, 1.2, 1.4, and 1.5.) |
In other words: we probably should not allow a |
It is worth noting that well-intentioned people like Brad or me may already have created My 2c is that |
Perhaps rather than rejecting the older versions, we should upgrade them to |
I don't think a marker for “compatibility all the way back” is a good idea unless it is actually enforced, and I don't think it's worth the labor to retrofit actual enforcement. Without enforcement, the marker would give a false sense of confidence: once might expect that a package that successfully compiles with a |
If I have a very simple Go package that doesn't depend on any language features added since the original Go 1 release, I naturally thought I could put in my go.mod file:
But that doesn't parse:
But
go 1.0
is weird, because we never called it that. Is that correct? Docs don't say.go 1.1
is also weird, because it implies that I'm depending on something that was added in Go 1.1, but I'm not.So I guess
go 1.11
for when modules were introduced?/cc @ianlancetaylor @bcmills @jayconrod @dmitshur
The text was updated successfully, but these errors were encountered: