-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
gopls
can not work in project with go mod go 1.22
#293180
Comments
go 1.22
gopls
can not work in project with go mod go 1.22
using https://github.com/sumnerevans/nixpkgs-290212 looks like if gopls is built with go_1_22, it works on projects with go.mod 1.21 so easiest fix is to just bump or we could namespace tools under go itself eg |
thoughts @SuperSandro2000 ? ( as gopls maintainer ) EDIT, for some reason i though you were sole maintainer, but then i realised i confused |
I still don't think this is the right approach. Packages that currently don't work with Go 1.22.0 won't work with 1.22.1 either. Upstream must implement the support for the next minor version, so the constraint in toolchain is closely related to the package itself. That's why the package that depends on an older version of Go should explicitly pin that toolchain so that we can just use the latest Go release by default. This will also save us work in the long term, as we wouldn't introduce a new group of Go packages that need special treatment (be it with buildGoLatestModule or setting latest manual). Packages will still need to pin 1.21 if we update default later. |
I am a bit confused by this comment.
i said, its simplest
gopls ( package in question ) works with 1.22.0, should also work with 1.22.1
nixpkgs pins go for any package that is not compatible with default version I think, most likely there is just some miscommunication going on, so please treat my comments as such |
after reading your comment again, i think you suggestion is instead of pinning gopls and friends ( eg golangci-lint) is this right ? ( sorry for replying before you ) |
Packages that depend on older go versions are usually not good maintained or need an update. Lots of the go development tools need to be built with the latest version they should support. If we add a new alias that always points to the latest version, then we can probably forget to update the pinnings for those packages. Bumping the default go version is not always that easy and usually generates a bit of fallout and it is usually better to do that a bit delayed. |
i think @SuperSandro2000 sums it up pretty well, I was just hoping to avoid adding new alias |
Yes, that is my suggestion.
I understand this, but I think this is rather an issue on our side we should fix and not a problem intrinsic to the Go toolchain. |
given #293629 should we just bump |
I can confirm that using |
Ref: NixOS/nixpkgs#293180 Signed-off-by: budimanjojo <budimanjojo@gmail.com>
Describe the bug
Gopls not work with
go_1_22
in ago 1.22
go project.Steps To Reproduce
Steps to reproduce the behavior:
go_1_22
andgopls
in home-managermkdir hello && cd hello && go mod init "hello"
Println
, callGoToDefination
. Nothing happened.go.mod
file, change go version togo 1.21
, the editor can navigate to the definition.Expected behavior
At step 3, the editor can go to built-in definition for
fmt.Println
.Additional context
If needed, I can create a repo use flake.nix to reproduce these situation, or any other things to help to solve this.
Some other report: #290212 (comment)
Notify maintainers
@zowoq @kirillrdy
Metadata
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: