Typically a Go project will deal with two versions of Go:
- the version of Go installed on the host machine
- the minimum version of Go defined in
go.mod
I don't understand well when to upgrade the version in go.mod
vs. when not to (if that is ever the case). For example, if I have a locally installed Go 1.16.9, does it make sense to set go 1.19
in the go.mod
file? Should the Go version in go.mod
be on par with the locally installed version of Go? Can it be higher or lower?
Something that confuses me is the term minimum version of Go required by the current module
, i.e., is this similar to how Android has a minimum-compatibility version? Does a lower version in go.mod
mean the module can be installed on a wider range of machines and is this a good thing?