Skip to content

Go setup

Here are the steps to set up Go in VS Code with mise:

  1. Install the mise-vscode extension (if not already installed)
  2. Install the Go extension for VS Code
  3. 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.

Go setup

  1. mkdir my-go-project && cd my-go-project
  2. mise use go@latest
  3. go mod init example/hello
  4. Open the folder in VS Code and create a new file called hello.go with the following content:
    hello.go
    package main
    import "fmt"
    func main() {
    fmt.Println("Hello, World!")
    }
  5. 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.

dlv install notification

Alternatively, you can install dlv manually by running the following command:

Terminal window
go install -v github.com/go-delve/delve/cmd/dlv@latest