golang/go

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

Open

#36,319 opened on 2019年12月30日

GitHub で見る
 (7 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
DocumentationGoCommandNeedsFixhelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

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

コントリビューターガイド