Getting Started with GoLand
Setting up a workspace
It's recommended to keep all Go code in single a workspace with the following layout:
Also make sure the environment variable GOPATH is defined and points out to the workspace location. This variable will be used by Go commands and the IDE to resolve import statements, install, build and update packages, etc.
Setting up a project from existing sources
To import an existing project, click Open in the Welcome screen and select the project directory (preferably inside the workspace, see earlier).
After the project is opened, go to and select a Go distribution. If none available, make sure to download a copy, and then select it.
After the SDK is set, please wait until the IDE has indexed the workspace. This may take awhile but will pay off later with instant coding assistance.
Changing the Go SDK (GOROOT)
The Go SDK configuration process is the same if you use the Go AppEngine SDK.
Setting up a project from scratch
To create a blank project, click Create New Project in the Welcome screen and choose Go as your project type in the Project Wizard, then select a project SDK (or configure a new one as described above) by clicking Configure.
You’ll be prompted to choose a project name and directory (preferably inside the workspace, as described earlier ), and a Go SDK (GOROOT).
Changing the GOPATH settings
To run a Go application or tests written in Go, you'll need a Run Configuration. To define it, use the main menu . In the Run/Debug Configuration dialog (that shows up after you click Edit Configurations), click the Plus button and choose the type of Run Configuration that you need:
- The Go Application type is equal to go build command.
- The Go Single File type is equal to go run.
- The Go Test type is equal to go test. Make sure to select the test framework your tests use: gotest, gocheck or gobench.
- The Go App Engine type lets you deploy your application to Google AppEngine. Note, it requires your Go module to use a Go AppEngine SDK.
After your Run Configuration is configured, you can run it any time via the main menu Run → Run (or Debug if it's what you need).
Using coding assistance
- Basic code completion:N/A.
- Statement completion:N/A).
- See parameters for a method or constructor:N/A.
- Browse documentation for a symbol at the caret:N/A.
- Navigate to the declaration of a symbol at the caret:N/A.
- Navigate to the declaration of any symbol: hold Ctrl (Cmd for macOS) and click the left mouse button on that symbol.
- View current file structure:N/A. In that popup you can select a memmber and press Enter to navigate to it within the file.
- Rename a symbol at the caret:N/A. Press twice to see the Rename dialog with more options.
- Usually your code is being formatted automatically as you type. To re-format it manually, use or . Note that the Go fmt option is also available in the Commit Changes dialog as a Before Commit action.
- See a popup with usages of a symbol at the caret:N/A. To see usages in a tool window, press N/A. For more options, pressN/A.
- Expand a live template: type its abbreviation in the Editor and press Tab. To see the list of all available live templates and to define your own, go to and find the Go group.
- Debugger actions: Step Over viaN/A, Step Into viaN/A, Evaluate Expression via N/A and Toggle Breakpoint viaN/A.
We also recommend that you read the Discover IntelliJ IDEA document to better know how IntelliJ-based IDE work.
To better know how the IntelliJ platform works, we recommend that you read the Discover IntelliJ IDEA document.
Sending your feedback
Your feedback is welcome in the GoLand issue tracker at https://youtrack.jetbrains.com/issues/GO