You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The go directive in a go.mod file now indicates the version of the language used by the files within that module, and go mod tidy sets it to the current release (go 1.12) if no existing version is present.
The version is not just being added by go mod tidy, but also go build and go test.
$ echo "module github.com/neild/foo" > go.mod
$ echo "package foo" > foo.go
$ go test .
? github.com/neild/foo [no test files]
$ cat go.mod
module github.com/neild/foo
go 1.12
I don't know if the relnotes or the behavior is in error.
The text was updated successfully, but these errors were encountered:
I know this is closed, but FWIW, it is not obvious to me what triggers adding a missing go version directive. go mod init adds it. Things like go build and go mod tidy do not seem to add a missing go version directive, with seemingly the exception if you do not have any require statements then go build or go mod tidy seem to add a missing go version directive.
The draft 1.12 release notes used to say go mod tidy is what would trigger adding a missing go version directive, but that was seemingly removed in the final version of the release notes:
The 1.12 release notes say:
The version is not just being added by
go mod tidy
, but alsogo build
andgo test
.I don't know if the relnotes or the behavior is in error.
The text was updated successfully, but these errors were encountered: