Go: errors parsing go.mod:

I built a Simple API with Go + Gin Gonic and now trying to deploy it on Render. I kept getting this error messages:

Sep 27 03:56:17 PM  ==> Build failed ๐Ÿ˜ž
Sep 27 03:56:17 PM  ==> Using Node version 14.17.0 (default)
Sep 27 03:56:17 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Sep 27 03:56:17 PM  ==> Using Go version go version go1.20.5 linux/amd64
Sep 27 03:56:17 PM  ==> Running build command 'go build -tags netgo -ldflags '-s -w' -o main'...
Sep 27 03:56:17 PM  go: errors parsing go.mod:
Sep 27 03:56:17 PM  /opt/render/project/go/src/github.com/adeisagopher/quotesmonger/go.mod:3: invalid go version '1.21.1': must match format 1.23

Iโ€™ve search the entire internet and stackoverflow but itโ€™s futile, anyone here know how I can fix this?

Hi Adewale,

Can you post the contents of your go.mod file, based on that error it sounds like you need to specify a version with just a Major and Minor version.

Worth noting that we currently only support a single version of Go in our Native Environment at one time, and thatโ€™s currently 1.20

Regards,

Matt

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.