I am getting started with Go and would like to use Visual Studio Code for editing. I successfully installed go on my Ubuntu Computer.
My GOPATH
(go env) is set to the same value as go.gopath
in settings.json. If I run Go: Current GOPATH
it outputs the correct path.
However, I am not able to install the go extensions. If I click on Install all
I get output similar to this:
Installing 1 tool at home/jan/go/bin
dlv
Installing github.com/go-delve/delve/cmd/dlv FAILED
1 tools failed to install.
dlv:
Error: Command failed: /snap/bin/go get -u -v github.com/go-delve/delve/cmd/dlv
I seem to be able to just install packages manually with /snap/bin/go get -u -v github.com/go-delve/delve/cmd/dlv
. The command runs without errors, but VSCode seems to be unable to find dlv.
My settings.json:
{
"terminal.integrated.rendererType": "dom",
"go.useLanguageServer": true,
"go.formatTool": "gofmt",
"go.lintOnSave": "file",
"go.vetOnSave": "package",
"go.buildOnSave": "package",
"go.lintTool": "golint",
"go.gopath": "home/jan/go"
}
I have git installed on my computer. It works without a problem.