Go setup
Here are the steps to set up Go in VS Code with mise:
- Install the mise-vscode extension (if not already installed)
- Install the Go extension for VS Code
- Open a project with a
mise.toml
file (or any other files supported by mise)
If you do not have a go
project ready and want to quickly try out Go, you can use the following commands:
mise-vscode
will automatically detect the Go tools in your project and configure the Go extension to use them.
-
mkdir my-go-project && cd my-go-project
-
mise use go@latest
-
go mod init example/hello
- Open the folder in VS Code and create a new file called
hello.go
with the following content:hello.go package mainimport "fmt"func main() {fmt.Println("Hello, World!")} - Click the
run and debug
button in the editor
If you want to debug a Go program, you will need to install the dlv
debugger.
You can do this by clicking on the notification that appears when you run a Go file for the first time.
Alternatively, you can install dlv
manually by running the following command:
go install -v github.com/go-delve/delve/cmd/dlv@latest