DEV Community

Bosco Domingo
Bosco Domingo

Posted on • Edited on

Set up Go with mise (version management) and the VS Code/Cursor extension

2025 update: Go is natively supported by mise so the asdf plugin is no longer needed. The bug I mention below was fixed too, so it's even easier now!


This comes from my answer in the official Go - VS Code Extension repo:

For mise the solution is to point to wherever mise where go points to (or which go, but the former is preferred), which should be the mise folder.

Resulting settings.json:

"go.alternateTools": {
    "go": "~/.local/share/mise/installs/go/latest/go/bin/go"
},
Enter fullscreen mode Exit fullscreen mode

However, this will pin it to one specific version due to what seems like a bug (in my case mise install go@latest installed 1.23.0 instead of 1.23.1 as of writing, and saved it to ~/.local/share/mise/installs/go/1.23.0).

To fix this, use the asdf-golang plugin (mise p i https://github.com/asdf-community/asdf-golang) which will install it correctly to ~/.local/share/mise/installs/go/latest/go/bin/go which you can then add to your settings.json:

Top comments (2)

Collapse
 
hverlin profile image
Hugues Verlin

Here is a VSCode plugin I made which can configure golang + delve with mise automatically (see hverlin.github.io/mise-vscode/guid...) if you are interested

Collapse
 
boscodomingo profile image
Bosco Domingo

That's actually quite cool, love to see it! I'll give it a go