Skip to content
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

bump go version to 1.18 #44

Merged
merged 1 commit into from
Oct 10, 2024
Merged

bump go version to 1.18 #44

merged 1 commit into from
Oct 10, 2024

Conversation

trevorwhitney
Copy link
Contributor

Can we bump the go.mod version to 1.18? I can't seem to build v1.13.0 without out, and using older versions produces errors but fails to build

Using older versions of faillint against go code built on newer version of go (1.23 in this case) I see problems in the types library

> go/types.(*Checker).funcBody(0xc00220d000, 0x7e8298?, {0xc001ed29a4?, 0xc00133c280?}, 0xc000228640, 0xc0021a7b60, {0x0?, 0x0?})
       >         go/types/stmt.go:41 +0x331
       > go/types.(*Checker).funcDecl.func1()
       >       go/types/decl.go:852 +0x3a
       > go/types.(*Checker).processDelayed(0xc00220d000, 0x0)
       >      go/types/check.go:467 +0x162
       > go/types.(*Checker).checkFiles(0xc00220d000, {0xc0000a01e8, 0x1, 0x1})
       >   go/types/check.go:411 +0x1cc
       > go/types.(*Checker).Files(...)
       >   go/types/check.go:372
       > golang.org/x/tools/go/packages.(*loader).loadPackage(0xc0001921c0, 0xc001fe25c0)
       >        golang.org/x/tools@v0.1.12/go/packages/packages.go:1001 +0x76f
       > golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
       >         golang.org/x/tools@v0.1.12/go/packages/packages.go:838 +0x1a9
       > sync.(*Once).doSlow(0x0?, 0x0?)
       >         sync/once.go:74 +0xc2
       > sync.(*Once).Do(...)
       >    sync/once.go:65
       > golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
       >    golang.org/x/tools@v0.1.12/go/packages/packages.go:826 +0x4a
       > golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
       >     golang.org/x/tools@v0.1.12/go/packages/packages.go:833 +0x26
       > created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 3151
       >        golang.org/x/tools@v0.1.12/go/packages/packages.go:832 +0x94
       > make: *** [Makefile:343: lint] Error 2

When I try to switch to v1.13.0, I have trouble building it:

       > vendor/golang.org/x/tools/internal/event/keys/util.go:14:13: embedding interface element ~[]T requires go1.18 or later (-lang was set to go1.16; check go.mod)
       > vendor/golang.org/x/tools/internal/event/keys/util.go:14:21: embedding interface element ~string requires go1.18 or later (-lang was set to go1.16; check go.mod)
       > vendor/golang.org/x/tools/internal/event/keys/util.go:15:32: invalid argument: s (variable of type S constrained by ~[]T) for len
       > vendor/golang.org/x/tools/internal/event/keys/util.go:16:20: cannot range over s (variable of type S constrained by ~[]T): no core type
       > # golang.org/x/tools/internal/diff
       > vendor/golang.org/x/tools/internal/diff/ndiff.go:21:5: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
       > vendor/golang.org/x/tools/internal/diff/ndiff.go:35:5: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
       > vendor/golang.org/x/tools/internal/diff/ndiff.go:92:14: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
       > # golang.org/x/tools/internal/versions
       > vendor/golang.org/x/tools/internal/versions/types.go:15:16: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)

This PR fixes both problems, it builds and runs fine against my code.

@fatih
Copy link
Owner

fatih commented Oct 10, 2024

SGTM. Thank you @trevorwhitney

@fatih fatih merged commit 24d8e46 into fatih:main Oct 10, 2024
1 check passed
@fatih
Copy link
Owner

fatih commented Oct 10, 2024

@trevorwhitney
Copy link
Contributor Author

wow, crazy fast on the merge and the release! thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants