Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Go Concurrency VisualizerNew to Visual Studio Code? Get it now.
Go Concurrency Visualizer

Go Concurrency Visualizer

Sarthak Saraiya

|
1 install
| (0) | Free
Explore goroutines and channels in Go code with interactive graphs and static concurrency checks.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Go Concurrency Visualizer

A VS Code extension for seeing how goroutines and channels connect in Go source. Open a graph for one file or a whole module, then click a node to jump to the corresponding line. Potential problems appear in the Problems panel.

This is static analysis: it reads your source without running your program. The graph includes function scopes, goroutine launches, channels, selects, WaitGroups, and mutexes.

Getting started

You need VS Code 1.85 or later and Go 1.21 or later on your PATH. Open a trusted folder containing a Go module. For SSH, WSL, or containers, install Go on the remote host as well.

  1. Open a saved .go file.
  2. Click View concurrency graph above a function that uses concurrency, or run Concurrency Visualizer: Show Graph from the Command Palette.
  3. Click a node to open its source. Use Fit to bring the graph into view and Re-layout to arrange it again.

Try this in a main.go file inside a Go module:

package main

import "fmt"

func main() {
    done := make(chan struct{})
    go func() {
        fmt.Println("worker finished")
        close(done)
    }()
    <-done
}

The graph shows main, the goroutine it launches, and the done channel. Edges show the launch, channel close, and receive.

Run Concurrency Visualizer: Show Workspace Graph (all packages) to combine the packages in the first workspace folder. For a workspace with several root folders, only the first is analyzed.

Warnings

The extension checks for:

  • Goroutines with no recognized cancellation or completion signal in the spawning scope.
  • Channel sends with no receiver found in the analyzed code.
  • Goroutine launches in loops with no nearby synchronization operation.
  • More than one close on the same channel.
  • Sends on channels declared without an initializer.
  • Mutex locks without a deferred unlock.
  • Select statements with no default, timeout, or cancellation case.
  • Goroutines that capture loop variables, a pattern that can be unsafe with Go language versions before 1.22.

These are prompts to inspect the code, not confirmed bugs. For example, a short-lived goroutine may need no cancellation, a select may intentionally wait, and two closes in mutually exclusive branches may be safe. A WaitGroup does not by itself limit the number of concurrent goroutines.

What it misses

Analysis is based mainly on syntax. Channel, WaitGroup, and mutex names are tracked within each function; shadowing, aliases, struct fields, and values passed as parameters are not fully resolved. Goroutine function literals are walked, but a named call such as go worker() is shown as a launch without following the call into worker. Its declaration is analyzed separately if it is in the selected file or workspace.

Loop-variable warnings are not adjusted to your module's Go language version. CodeLens placement uses a lightweight scan of function bodies and can be inaccurate around braces in comments or strings. Files with package errors may produce incomplete graphs.

Analysis reads saved files. Saving updates CodeLens and Problems; run the graph command again to refresh an open graph. Browser-only, virtual, and untrusted workspaces are not supported. This extension does not replace go test -race or prove the absence of deadlocks or data races.

Troubleshooting

  • No graph link: save the file, then try Concurrency Visualizer: Show Graph. Files without recognized concurrency operations do not get CodeLens links.
  • Package loading fails: check go version in the environment running the extension, and run go list ./... from your module folder to check dependencies.
  • Analysis times out: try a single file or a smaller workspace. Requests stop after two minutes.
  • Analyzer fails to start: reinstall the extension for your operating system and architecture. Details are in Output → Concurrency Visualizer.

Privacy and platform support

The analyzer is bundled for macOS, Linux, and Windows on x64 and ARM64. Source analysis runs locally. The extension sends no telemetry and makes no API calls. Go's package loader may download missing module dependencies; cached dependencies allow offline use.

Feedback

Report a bug with your Go version, operating system, and a small example that reproduces it. The source code is available under the MIT license.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft