Closed jaypipes closed 3 days ago
FWIW, I tried deleting gopls
binary and updating the vim-go gopls install directive in the vim-go plugin to install v0.14.0
instead of latest
but continue to get the exact same error. So, I think this may be something with vim-go, not gopls.
Is the source code file either in GOPATH (e.g. /home/jaypipes/go/src
) or in a Go module (i.e. the source code file should either be in the same directory as a go.mod
file or it should be in a subdirectory of the directory that contains go.mod
)?
Is the source code file either in GOPATH (e.g.
/home/jaypipes/go/src
) or in a Go module (i.e. the source code file should either be in the same directory as ago.mod
file or it should be in a subdirectory of the directory that containsgo.mod
)?
@bhcleek thanks for your response. Yes, the source code file is in a subdirectory of the directory containing the go.mod
. Again, everything was working just fine last Friday. This Monday, all broken for some reason.
GOMOD='/dev/null'
looks like there isn't a go.mod
file.
What is the output of go env GOMOD
when executed in a shell from the directory that contains your source file?
Also, does your experience change if you set GO111MODULE=auto
?
GOMOD='/dev/null'
looks like there isn't ago.mod
file.What is the output of
go env GOMOD
when executed in a shell from the directory that contains your source file?Also, does your experience change if you set
GO111MODULE=auto
?
Hi again @bhcleek. OK, so some interesting developments...
go env GOMOD
correctly reports the go.mod file in the directory I'm in.
However, I saw (briefly, in the mode bar) an error about go env GOBIN
not succeeding, so I ran go env GOBIN
from my terminal (outside vim) and that downloaded go1.22.4 (I presume because the go.mod
file in the current directory had that Go version specified as the toolchain). In doing so, there was a message:
verifying module: checksum database disabled by GOSUMDB=off
which got me thinking, maybe if I unset
GOSUMDB and re-open a Go source code file in vim, that would do something?
And sure enough, when I did that, vim-go loaded up and in the mode bar I saw vim-go: initializing gopls
and then vim-goL Finished loading packages
and things seem to be OK now...
Anyway, I'll close this issue out, but in the future, if someone sees something like this, unset GOSUMDB
and retry :)
What did you do? (required: The issue will be closed when not provided)
Brand new vim installation (cleared ~/.vim, ~/.vimrc), generated new vimrc for Go with Vim Bootstrap.
Opening any Go file results in a failure:
This problem just started happening this morning. Everything was working just fine last Friday...
What did you expect to happen?
Go files should be opened properly by vim.
What happened instead?
Configuration (MUST fill this out):
vim-go version:
vimrc
you used to reproduce:Vim version (first three lines from
:version
):Go version (
go version
):Go environment
gopls version