A Visual Studio Code extension that adds language support for Go, including navigation, editing, diagnostics, testing, and debugging via gopls and related tools.
Overview
The Go extension for Visual Studio Code provides language features for Go source files and modules. After installation, opening a Go file or go.mod activates the extension and shows Go version status in the editor status bar.
It relies on the Go toolchain, gopls as the language server, and optional tools that can be installed through extension commands. Capabilities include symbol IntelliSense, go-to-definition, formatting, automatic import organization, build and vet diagnostics, and enhanced testing and debugging workflows.
The extension supports both GOPATH and Go modules workspaces, with guidance for multi-module layouts via workspace folders. Commands are available from the command palette on Linux, Windows, and macOS. Optional Go telemetry for the language server is off by default and can be enabled separately.
The extension is maintained by the Go tools team and targets recent Go releases and current versions of gopls and delve.
Key features
- IntelliSense and code navigation
- Formatting and import organization
- Build, vet, and lint diagnostics
- Testing and debugging integration
- gopls language server support
- Go modules and GOPATH workspaces
- Command palette tooling commands
- Optional semantic highlighting via gopls
Use cases
- Daily Go development in VS Code
- Debugging Go applications
- Managing Go modules in the editor
- Running and authoring Go tests