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
We're using a go.work layout in a monorepo, and setting gopackagesdriver in VSCode using it with gopls, results in a query to the gopackagesdriver that is only ./... builtin - this does not resolve any modules from the go.work file, nor finds any go.mod files within the workspace.
It results in the very unintuitive Error message in VSCode:
[Error - 12:30:22] 2025/02/05 12:30:21 go/packages.Load #1: unexpected end of JSON input
view_id="1"
snapshot=0
directory=/home/mikn/src
query=[./... builtin]
packages=0
duration=688.341518ms
[Error - 12:30:22] 2025/02/05 12:30:21 initial workspace load failed: packages.Load error: unexpected end of JSON input
The error was figured out by looking at what the query field is set to when not using an external GOPACKAGESDRIVER, which, to go list is expanded to each module defined in the go.work file.
I am not sure this is a bug with the rules_go gopackagesdriver, or if it is gopls that is sending the wrong query in external mode, but we decided to fix it in the gopackagesdriver wrapper as it was the easiest place for us and I suspect that it may be the easiest to fix in rules_go also.
The text was updated successfully, but these errors were encountered:
We're using a
go.work
layout in a monorepo, and setting gopackagesdriver in VSCode using it withgopls
, results in a query to the gopackagesdriver that is only./... builtin
- this does not resolve any modules from thego.work
file, nor finds anygo.mod
files within the workspace.It results in the very unintuitive Error message in VSCode:
The error was figured out by looking at what the
query
field is set to when not using an externalGOPACKAGESDRIVER
, which, togo list
is expanded to each module defined in thego.work
file.We fixed this for now, by doing this:
I am not sure this is a bug with the rules_go gopackagesdriver, or if it is gopls that is sending the wrong query in external mode, but we decided to fix it in the gopackagesdriver wrapper as it was the easiest place for us and I suspect that it may be the easiest to fix in
rules_go
also.The text was updated successfully, but these errors were encountered: