Rdhill
Rdhill

Reputation: 57

VSCODE ON Monterey not working with Golang

I get the following error on vscode on Monterey with golang Tools environment: GOPATH=/Users/randolphhill/devgo/workspace, GOBIN=/Users/randolphhill/devgo/workspace/bin Installing 1 tool at the configured GOBIN: /Users/randolphhill/devgo/workspace/bin in module mode. dlv

Installing github.com/go-delve/delve/cmd/dlv@latest FAILED { "killed": false, "code": 2, "signal": null, "cmd": "/usr/local/opt/go/libexec/bin/go install -v github.com/go-delve/delve/cmd/dlv@latest", "stdout": "", "stderr": "go: cannot find GOROOT directory: /usr/local/opt/libexec\n" }

1 tools failed to install.

dlv: failed to install dlv(github.com/go-delve/delve/cmd/dlv@latest): Error: Command failed: /usr/local/opt/go/libexec/bin/go install -v github.com/go-delve/delve/cmd/dlv@latest go: cannot find GOROOT directory: /usr/local/opt/libexec

Upvotes: 0

Views: 605

Answers (1)

DirtySocrates
DirtySocrates

Reputation: 76

That seems like an odd GOROOT path. Have you tried uninstalling and reinstalling Go?

I have go installed and it is located at /usr/local/go/bin/go not /usr/local/opt/go/libexec/bin/go.

From the Go website: https://go.dev/doc/manage-install; The default install location is usually /usr/local/go.

Upvotes: 0

Related Questions