What is the meaning of the "go" line in go.mod

118 views
Skip to first unread message

George Hartzell

unread,
Dec 11, 2019, 6:57:22 PM12/11/19
to GoLang Nuts

Hi All,

What meaning should I attach to the "go" line in go.mod, e.g.

go 1.13

It's not mentioned in the module wiki's [list of go mod
directives](https://github.com/golang/go/wiki/Modules#gomod).

It seems to be the version of the `go` command that last touched the
go.mod file.

What, if anything, does it assert about the version of go needed to
build the project? Is it the only version or the minimal version or
...?

Thanks,

g.

Everton Marques

unread,
Dec 11, 2019, 7:07:46 PM12/11/19
to golang-nuts

Kurtis Rader

unread,
Dec 11, 2019, 7:08:28 PM12/11/19
to hart...@alerce.com, GoLang Nuts
On Wed, Dec 11, 2019 at 3:57 PM George Hartzell <hart...@alerce.com> wrote:
What meaning should I attach to the "go" line in go.mod, e.g.

    go 1.13

It's not mentioned in the module wiki's [list of go mod
directives](https://github.com/golang/go/wiki/Modules#gomod).

I don't know if there is a more canonical answer in the official documentation but this seems to explain it reasonably well:


--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

Caleb Spare

unread,
Dec 11, 2019, 7:09:23 PM12/11/19
to hart...@alerce.com, GoLang Nuts
There is ongoing discussion here: https://github.com/golang/go/issues/30791

Unfortunately it has been taking way too long for this to get
documented. People are spending a lot of time debating what the go
directive should be in go.mod files in their projects because there is
no official recommendation.
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/24049.33340.893632.747166%40alice.local.
Reply all
Reply to author
Forward
0 new messages