You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The go version at the time of writing is
$ go version
go version go1.19.9 linux/amd64
which is behind 1.20.6.
golangci-lint uses go as far as I know for some of it's analysis. So using go 1.20.x features will lead to lint errors
if the available go version in megalinter is 1.19.
Linter will fail with undefined: time.DateOnly (typecheck)
Expected behavior
I would like to align the go version to the version I'm using in my build stack so that the linter does not warn me that values which exist are undefined.
Some people consider 1.19.x as stable while 1.20.x is latest, so it's not technically wrong perhaps only not easily visible. So technically both are correct and there's no 1 size fits all here. Short to having an option to specify and install a specific version of go before linting (which would probably not be great performance wise) or bundling multiple versions of go (which is not great size wise).
I figured it's good to document this quirk via an issue but I understand the constrains and that there's no easy solution (IMHO fine to close it as a wontfix in that case) as a work around since my setup involves creating a new image with megalinter as a base image i could solve this by installing a different go version there.
The text was updated successfully, but these errors were encountered:
Describe the bug
The go version at the time of writing is
which is behind 1.20.6.
golangci-lint uses go as far as I know for some of it's analysis. So using go 1.20.x features will lead to lint errors
if the available go version in megalinter is 1.19.
Looks like alpine 3.17 is on 1.19: https://pkgs.alpinelinux.org/packages?name=go&branch=v3.17&repo=&arch=&maintainer=
To Reproduce
Steps to reproduce the behavior:
time.DateOnly
(time: add DateTime, DateOnly, TimeOnly format constants golang/go#52746)undefined: time.DateOnly (typecheck)
Expected behavior
I would like to align the go version to the version I'm using in my build stack so that the linter does not warn me that values which exist are undefined.
Some people consider 1.19.x as stable while 1.20.x is latest, so it's not technically wrong perhaps only not easily visible. So technically both are correct and there's no 1 size fits all here. Short to having an option to specify and install a specific version of go before linting (which would probably not be great performance wise) or bundling multiple versions of go (which is not great size wise).
I figured it's good to document this quirk via an issue but I understand the constrains and that there's no easy solution (IMHO fine to close it as a wontfix in that case) as a work around since my setup involves creating a new image with megalinter as a base image i could solve this by installing a different go version there.
The text was updated successfully, but these errors were encountered: