goadesign / goa

🌟 Goa: Elevate Go API development! 🚀 Streamlined design, automatic code generation, and seamless HTTP/gRPC support. ✨
https://goa.design
MIT License
5.54k stars 556 forks source link

go.mod shouldn't specify Go patch version #3556

Open vbrown608 opened 1 week ago

vbrown608 commented 1 week ago

Thanks for your work on this project! Looks like the most recent release specifies a patch version for Go in the go.mod file. This is causing CLI install to fail for me with the following error:

go: goa.design/goa/v3/cmd/goa@v3 (in goa.design/goa/v3@v3.17.2): go.mod:3: invalid go version '1.21.0': must match format 1.23

I'm using Go 1.20.

raphael commented 1 week ago

The latest Go versions (starting with 1.21) handle this version differently making specifying the build version the best practice, see https://tip.golang.org/doc/go1.21#tools (third paragraph):

To improve forwards compatibility, Go 1.21 now reads the go line in a go.work or go.mod file as a strict minimum requirement: go 1.21.0 means that the workspace or module cannot be used with Go 1.20 or with Go 1.21rc1. This allows projects that depend on fixes made in later versions of Go to ensure that they are not used with earlier versions. It also gives better error reporting for projects that make use of new Go features: when the problem is that a newer Go version is needed, that problem is reported clearly, instead of attempting to build the code and printing errors about unresolved imports or syntax errors.