Skip to main content

VSCode for GoLang

From this page: https://learn.microsoft.com/en-us/azure/developer/go/configure-visual-studio-code

1. Install Go

Install Go from the official page. This installs the compiler, the Standard Library, and many tools to perform various common tasks during Go development. To install Go, follow these steps:

  1. In a web browser, go to go.dev/doc/install.
  2. Download the version for your operating system.
  3. Once downloaded, run the installer.
  4. Open a command prompt, then run go version to confirm Go was installed.

2. Install Visual Studio Code

Next, install Visual Studio Code, which provides basic code editing functionality. Follow these steps to install Visual Studio Code:

  1. Open a web browser and go to code.visualstudio.com.
  2. Download the version for your operating system. Visual Studio Code supports Windows, Linux, and macOS.
  3. Once downloaded, run the installer.

3. Install the Go extension

Install and configure the Go for Visual Studio Code extension. Visual Studio Code and the Go extension provide IntelliSense, code navigation, and advanced debugging.

Instructions Screenshot
In Visual Studio Code, bring up the Extensions view by clicking on the Extensions icon in the Activity Bar. Or use keyboard shortcut (Ctrl+Shift+X). A screenshot showing how search for the Go extension.
Search for the Go extension, then select install. A screenshot showing how to use the search box in the top tool bar to find App Services in Azure.

4. Update the Go tools

Instructions Screenshot
In Visual Studio Code, open Command Palette's Help > Show All Commands. Or use the keyboard shortcut (Ctrl+Shift+P) A screenshot showing how search the Command Palette.
Search for Go: Install/Update tools then run the command from the pallet A screenshot showing how to run the Go: install/update tool from the command pallet.
When prompted, select all the available Go tools then select OK. A screenshot showing how to update all the available Go tools.
Wait for the Go tools to finish updating. A screenshot showing all the Go tools that were updated.

5. Write a sample Go program

In this step, you write and run a sample Go program to make sure everything is working correctly.