Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Go Deps NavigatorNew to Visual Studio Code? Get it now.
Go Deps Navigator

Go Deps Navigator

Dhruv Gupta

|
1 install
| (0) | Free
Explore and navigate Go dependencies in your workspace
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Go Deps Navigator

A Visual Studio Code extension that provides an explorer view for Go dependencies in your workspace.

Features

  • Dependency Tree View: Shows all Go dependencies in a dedicated explorer pane
  • Multiple go.mod Support: Handles workspaces with multiple go.mod files
  • Full Directory Navigation: Browse the complete directory structure of dependencies
  • File Tree Explorer: Expand dependencies to see all files and subdirectories
  • Clickable Navigation: Click on any file to open it directly in the editor
  • Replace Directive Support: Handles replace directives in go.mod files
  • Local Directory Navigation: Navigate to local replacement directories
  • Auto-refresh: Automatically updates when go.mod files change
  • Indirect Dependencies: Shows both direct and indirect dependencies with clear labeling
  • Smart Icons: Different icons for Go files, directories, markdown files, and other file types
  • Visual Indicators: Distinct icons and labels for local replacements vs regular dependencies

How it works

  1. The extension scans your workspace for go.mod files
  2. For each go.mod file, it parses the dependencies and replace directives
  3. Dependencies are displayed in a tree view in the Explorer pane
  4. Local replacements show the local directory path instead of module cache
  5. Expand any dependency to browse its complete directory structure
  6. Navigate through folders and files just like in your regular file explorer
  7. Click on any file to open it directly in VS Code
  8. The extension automatically downloads dependencies if they're not already cached (skipped for local replacements)

Navigation Features

  • Expandable Dependencies: Each dependency can be expanded to show its file structure
  • Directory Browsing: Navigate through subdirectories within dependencies
  • File Types: Different icons for Go files (.go), markdown files (.md), and other file types
  • Sorted Display: Directories appear first, followed by files, both sorted alphabetically
  • Direct File Access: Click any file to open it immediately in the editor

Replace Directive Support

The extension fully supports replace directives in your go.mod files:

  • Local Replacements: replace github.com/example/module => ./local-path

    • Shows as module-name → local-folder (local) in the tree
    • Navigate directly to your local development directory
    • Special folder icon to distinguish from regular dependencies
  • Remote Replacements: replace github.com/example/module => github.com/fork/module v1.2.3

    • Shows the replacement target in the dependency label
    • Downloads and caches the replacement module
  • Visual Indicators: Local replacements have distinct icons and labels for easy identification

Example go.mod with replace directives:

module myproject

go 1.19

require (
    github.com/gin-gonic/gin v1.9.1
    github.com/myorg/shared v1.0.0
)

replace github.com/myorg/shared => ./shared-lib
replace github.com/gin-gonic/gin => github.com/myorg/gin-fork v1.9.2

In the extension, you'll see:

  • github.com/gin-gonic/gin → github.com/myorg/gin-fork (v1.9.2) - remote replacement
  • github.com/myorg/shared → shared-lib (local) - local replacement

Requirements

  • Go must be installed and available in your PATH
  • The extension activates when Go files are present in your workspace

Usage

  1. Open a Go project with one or more go.mod files
  2. The "Go Dependencies" view will appear in the Explorer pane
  3. Expand any go.mod file to see its dependencies
  4. Expand any dependency to browse its directory structure
  5. Navigate through folders and click on any file to open it
  6. Use the refresh button to manually update the dependency list

Development

To build and run the extension:

  1. Install dependencies: npm install
  2. Compile TypeScript: npm run compile
  3. Press F5 to launch a new VS Code window with the extension loaded

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft