golang/go
View on GitHubcmd/go: reject unenforced 'go' versions (older than 1.6) in 'go.mod' files
Open
#36,319 opened on Dec 30, 2019
DocumentationGoCommandNeedsFixhelp wanted
Repository metrics
- Stars
- (133,883 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
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:
go 1
But that doesn't parse:
$ go install
go: errors parsing go.mod:
/home/me/proj/go.mod:3: usage: go 1.23
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