'Can I view external Go libraries with VSCode?

I'd like to switch to using VSCode full time, but the one thing keeping me on IntellijIDEA is its ability to view Go standard and all dependency libraries in External Libraries of project which located in $GOROOT or $GOPATH/pkg/mod on the filesystem. In particular, I'd like it to work with Go. As of yet, I've been unable to find a suitable solution to view Go standard and all dependency libraries in the Explorer of VSCode.



Solution 1:[1]

You can do this with a few manual steps if you use Workspaces.

Once in a workspace (see link above if unfamiliar with the concept), you can use the GUI (Add folder to workspace) or, what I prefer, the integrated terminal (see example below).

From the integrated terminal:

$ code --add /path/to/"external library"

and the related library will appear in the explorer.

The added paths will be remembered by the workspace on vscode close and restart :-)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 marco.m