VS Code and Golang

VS Code doesn't have great support for version managers like asdf, and will look for and install tools in seemingly random locations. To fix this, set the following in your workspace settings:

  "go.goroot": "$myHome/.asdf/installs/golang/$version/go",
  "go.gopath": "$myHome/.asdf/installs/golang/$version/packages",

You can verify these values from the project directory with go env.


  1. Open the Command Palette and choose Reload Window. It might not do anything, but the world needs a little blind faith sometimes.
  2. Now run Go: Install/Update Tools, selecting all of the tools.