Install in Cursor
The Go by GoLand extension helps you work with Go code in Cursor, bringing code insight features from JetBrains GoLand.
Before you start
Make sure your editor is based on VS Code 1.105.1 or later.
Install Go. Go by GoLand detects the Go SDK from your
PATHor standard installation directories. To select an SDK explicitly, setgo.goroot. For more details, refer to Go SDK.Disable the Go extension by the Go team in the workspaces where you use Go by GoLand. If both extensions serve the same file, the editor shows duplicate completion items, diagnostics, and navigation results.
Log in to Cursor.
Install from the user interface
You can install the extension from the Open VSX Registry.
Switch to IDE mode by clicking IDE in the top-right corner or selecting (Ctrl+Shift+N) in the main menu.
Open the Extensions view (Ctrl+Shift+X), search for Go by GoLand, and click Install.
Install using the Quick Open menu
Switch to IDE mode by clicking IDE in the top-right corner or selecting (Ctrl+Shift+N) in the main menu.
Open the Quick Open menu (Ctrl+E).
Enter the following command and press Enter:
ext install JetBrains.goland-server
After installation
On the first start, Go by GoLand prepares the language server before opening a setup page in an editor tab.
Complete the initial setup
Select your region.
Accept the End User License Agreement (EULA).
Choose a data sharing option.
The language server starts after you complete all three steps. If you close the tab without accepting the agreement, it opens again the next time you open a project.
For steps to change your region or data sharing option later, refer to Change region and data sharing settings.
First start
Go by GoLand starts when you open a Go source file, go.mod, or go.work. The language server comes with its own Java runtime, so you do not need to install Java separately. If the required server version is unavailable locally, Go by GoLand downloads it before opening the setup page. This download requires an internet connection.
After the language server starts, Go by GoLand finds the Go modules in the workspace, imports them, and creates indexes for the module sources, their dependencies, and the Go SDK. Depending on the project size and available system resources, initial indexing may take longer. Code insight features may be limited until indexing is complete.
Open a workspace
Press Ctrl+Shift+P to open the Command Palette, and run File: Open Folder....
Navigate to the folder with your Go project and select Open.
Open any Go file. Hover over the Go by GoLand item in the Status Bar to check the language server status.
Work in WSL, over SSH, or in a Dev Container
For setup instructions, refer to the VS Code documentation for WSL, SSH, and Dev Containers.
When the extension runs in a remote extension host, its language server runs in the same environment, not on your local machine.
Prepare the remote environment
When you open a folder in WSL, over SSH, or in a Dev Container, install Go by GoLand in that remote environment.
Install Go in the remote environment. To select an SDK there, use
go.gorootwith a path on the remote machine.Download the module dependencies in the remote environment, for example, with
go mod download.To debug, install Delve in the remote environment.
In WSL, Go by GoLand starts the language server with the -Djava.net.preferIPv4Stack=true JVM option.
Use IPv6 in WSL
To use IPv6 instead, add
-Djava.net.preferIPv4Stack=falseto the Additional JVM arguments setting.