Gopls: failed to install gopls on VsCode

Just go started with Go and I’m having difficulties installing gopls on Vscode.

Tools environment: GOPATH=/Users/maxgod/go
Installing 1 tool at /Users/maxgod/go/bin in module mode.
  gopls

Installing golang.org/x/tools/gopls@latest FAILED
{
 "code": 1,
 "killed": false,
 "signal": null,
 "cmd": "/usr/local/go/bin/go install -v golang.org/x/tools/gopls@latest",
 "stdout": "",
 "stderr": "runtime/cgo\n# runtime/cgo\nxcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\n"
}

1 tools failed to install.

gopls: failed to install gopls(golang.org/x/tools/gopls@latest): Error: Command failed: /usr/local/go/bin/go install -v golang.org/x/tools/gopls@latest
runtime/cgo
# runtime/cgo
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I don’t know Mac, but it looks like maybe you have to (re)install Xcode?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.