What version should the go.mod "go directive" be set too?

Written by
Link to Post

https://www.reddit.com/r/golang/comments/b0b8k3/what_version_should_the_gomod_go_directive_be_set/ by 

As of Go 1.12 a new directive “go” has been added to go.mod.


> The go directive in a go.mod file now indicates the version of the language used by the files within that module. It will be set to the current release (go1.12) if no existing version is present. If the go directive for a module specifies a version newer than the toolchain in use, the go command will attempt to build the packages regardless, and will note the mismatch only if that build fails.

It’s unclear to me what this value should be set too. Is it the minimum supported version of Go? The version of Go the module was created at (or the version modules were added at)? Is it always the most recent supported version?

submitted by /u/kpurdon
[link] [comments]

Article Tags:
· ·
Article Categories:

Leave a Reply