Skip to content

Errors when running on Go 1.23 projects #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
runar-rkmedia opened this issue Dec 13, 2024 · 3 comments · Fixed by #68
Closed

Errors when running on Go 1.23 projects #62

runar-rkmedia opened this issue Dec 13, 2024 · 3 comments · Fixed by #68
Labels
bug Something isn't working

Comments

@runar-rkmedia
Copy link

runar-rkmedia commented Dec 13, 2024

I tried running this standalone today, after seeing no errors reported in golangci on a repository where they should be reported.

 sloglint -attr-only true -no-global all ./...
-: This application uses version go1.22 of the source-processing packages but runs version go1.23 of 'go list'. It may fail to process source files that rely on newer language features. If so, rebuild the application using a newer version of Go.
./document_client.go:1:1: package requires newer Go version go1.23
...
sloglint: 8 errors during loading

 sloglint -V
sloglint version 0.7.2 linux/amd64
go version go1.23.3 linux/amd64

Not really sure what that message really indicates. Is it just my setup?

@romanchechyotkin
Copy link

hello, can you provide your go.mod file

@tmzane
Copy link
Member

tmzane commented Feb 4, 2025

I confirm, just reproduced it with the latest sloglint running on a Go 1.23 project. This is completely unexpected for me. I'll bump the Go version to 1.23, which will most likely fix the problem. Thanks for the report!

@tmzane tmzane changed the title sloglint: 8 errors during loading Errors when running on Go 1.23 projects Feb 4, 2025
@tmzane tmzane added the bug Something isn't working label Feb 4, 2025
@tmzane tmzane closed this as completed in #68 Feb 6, 2025
@ldez
Copy link
Contributor

ldez commented Feb 8, 2025

sloglint version 0.7.2 linux/amd64

As the version displayed inside this message is 0.7.2, I guess the linter has been installed using the prebuild binaries.

$ ./sloglint -V                                                                                     
sloglint version 0.7.2 linux/amd64

$ go version -m ./sloglint    
sloglint: go1.22.4
        path    go-simpler.org/sloglint/cmd/sloglint
        mod     go-simpler.org/sloglint (devel)
        dep     github.com/ettle/strcase        v0.2.0  h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q=
        dep     golang.org/x/mod        v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
        dep     golang.org/x/sync       v0.7.0  h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
        dep     golang.org/x/tools      v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
        build   -buildmode=exe
        build   -compiler=gc
        build   -trimpath=true
        build   DefaultGODEBUG=httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
        build   CGO_ENABLED=0
        build   GOARCH=amd64
        build   GOOS=linux
        build   GOAMD64=v1
        build   vcs=git
        build   vcs.revision=878f37984f6dc58aea8295e285c1bf90bc848b4e
        build   vcs.time=2024-06-21T15:28:31Z
        build   vcs.modified=true

The prebuilt binary of v0.7.2 was built using go1.22.4, so the error is expected with go1.23.

The problem is not the minimum Go version but the Go version used to build the binary.

Technically, no changes are required, you only need to recompile the binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants