Re: Parser error in Golang version

From: Peter Jeremy <peterj_at_freebsd.org>
Date: Mon, 09 Oct 2023 08:58:44 UTC
On 2023-Oct-07 04:45:14 +0000, nulldutra <nulldutra@proton.me> wrote:
>I will update the sysutils/terraform port, but, I found a bug in golang version parser.
>If I change the version in go.mod to 1.21, the make makesum works. Any options to resolve this?
>
>Error:
>
>/usr/local/poudriere/ports/MAIN/distfiles/go/sysutils_terraform/terraform-v1.6.0/go.mod:275: invalid go version '1.21.1': must match format 1.23

Go changed the format of the "go" version string in 1.21: Prior to Go
1.21, the format is "1.M", with 1.21 and later, it's "1.M.N".  One
side-effect is that if you configure a go.mod for go 1.21, you will
get a format error with older version of Go.  In reality, this
shouldn't be serious problem because a line of the form "go 1.21.0"
means that Go 1.21.0 is the earliest version that is supported.

There's some discussion of this change in the Go 1.21 release notes
(https://tip.golang.org/doc/go1.21).

-- 
Peter Jeremy