golang/go

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

Open

#36,319 创建于 2019年12月30日

在 GitHub 查看
 (7 评论) (0 反应) (0 负责人)Go (19,008 fork)batch import
DocumentationGoCommandNeedsFixhelp wanted

仓库指标

Star
 (133,883 star)
PR 合并指标
 (30 天内没有已合并 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

贡献者指南