golang/go

cmd/go: reject unenforced 'go' versions (older than 1.6) in 'go.mod' files

Open

#36.319 aperta il 30 dic 2019

Vedi su GitHub
 (7 commenti) (0 reazioni) (0 assegnatari)Go (19.008 fork)batch import
DocumentationGoCommandNeedsFixhelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor