Getting Started
Downloading Go
Section titled “Downloading Go”To check the installed version, run the following command:
go versionGopls: The Language Server for Go
Section titled “Gopls: The Language Server for Go”To install the latest stable release of gopls, run the following command:
go install golang.org/x/tools/gopls@latestSome editors, such as VS Code, will handle this step for you, and ensure that gopls is updated when a new stable version is released.
To check the installed version, run the following command:
gopls versionSetting Up VS Code for Go
Section titled “Setting Up VS Code for Go”Install the Go extension for VS Code.
Use the following recommended settings in Preferences: Open User Settings (JSON) to enable semantic highlighting, automatically update tools, and set the default formatter for Go.
{ "editor.semanticHighlighting.enabled": true, "gopls": { "ui.semanticTokens": true }, "go.toolsManagement.autoUpdate": true, "[go]": { "editor.defaultFormatter": "golang.go" }}