run the GoUpdateBinaries command in neovim
all the tools should be installed automatically
there's an error when installing gopls:
Error installing golang.org/x/tools/gopls@latest: go: cannot find main module; see 'go help modules'
let g:go_fmt_command = 'goimports'
let g:go_def_mode = 'gopls'
let g:go_metalinter_command = 'golangci-lint'
latest(c67d72c476ff08bd631588429ef47d0aee75af27)
vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):vimrc
let g:go_fmt_command = 'goimports'
let g:go_def_mode = 'gopls'
let g:go_metalinter_command = 'golangci-lint'
:version):
neovim 0.3.4
go version):
go version go1.11.11 linux/amd64
go env Output:
GOARCH="amd64"
GOBIN="/home/s/go/bin"
GOCACHE="/home/s/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/s/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/s/.vim/plugged/vim-go/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build046431507=/tmp/go-build -gno-record-gcc-switches"
I get similar error when running the command go get -u golang.org/x/tools/gopls@latest in the terminal.
To make this work, I have to cd into $GOPATH/src/golang.org/x/tools/ and then run the go get command
Do you have $GO111MODULE set?
Do you have
$GO111MODULEset?
I have the same error with GO111MODULE set to on/off.
Unsetting GO111MODULE doesn't help either
This is happening because you're using go 1.11. If you'll upgrade to go 1.12, then :GoUpdateBinaries will work as expected.
This is happening because you're using go 1.11. If you'll upgrade to go 1.12, then
:GoUpdateBinarieswill work as expected.
Upgrading to 1.12 did fix the problem, thanks for the tip :)
Perhaps you should add this requirement to README
Most helpful comment
Upgrading to 1.12 did fix the problem, thanks for the tip :)
Perhaps you should add this requirement to README