GoLand 2025.1 Help

Go (GOPATH)

You might want to create this type of project if you do not need complex dependency management and are ready to store all project files under GOPATH.

Create a Go (GOPATH) project

  1. Click File | New | Project. Alternatively, on the Welcome screen, click New Project.

  2. In the New Project dialog, select Go (GOPATH).

  3. In the Location field, specify the location where you want to store your project.

  4. In the GOROOT field, specify the location of your Go installation. GoLand usually detects this location automatically.

    To change or install a new Go SDK version, click Add SDK (Add SDK icon) and choose one of the following options:

    • Local: to use an existing SDK from your local system.

    • Download: to download a Go SDK version from the official repository.

  5. (Optional) Use the Index entire GOPATH checkbox to control indexing:

    • Clear the checkbox to index only project files and vendored packages. Packages from GOPATH will not be indexed, which may improve performance.

    • Select the checkbox to index both project files and packages from GOPATH.

  6. Click Create to create the project.

    Create a project with Go (GOPATH) integration

Add and install dependencies

GOPATH stores your codebase and all the files required for development. It also includes any packages that you download and install. When GOPATH indexing is disabled, only project files and vendored packages are indexed. This may improve performance but prevents you from using packages located in GOPATH.

If your project has external dependencies, consider enabling indexing for the entire GOPATH. By default, this option is disabled.

Disable Go modules in a project

Enable entire GOPATH indexing

  1. Open settings by pressing Ctrl+Alt+S and navigate to Go GOPATH.

  2. Select the Index entire GOPATH checkbox.

Download and install dependencies

  1. Click an unresolved dependency in the import statement and press Alt+Enter.

  2. Select go get -t <package> from the list of intention actions.

    Download and install dependencies

Installing Go SDK

Select a local copy of the Go SDK

  1. Press Ctrl+Alt+S to open settings and then select Go | GOROOT.

  2. Click the Add SDK button (the Add SDK button) and select Local.

  3. In the file browser, navigate to the SDK version that is on your hard drive.

  4. Click Open.

    Installing Go SDK

Download the Go SDK

  1. Press Ctrl+Alt+S to open settings and then select Go | GOROOT.

  2. Click the Add SDK button (the Add SDK button) and select Download.

  3. From the Version list, select the SDK version.

  4. In the Location field, specify the path for the SDK. To use a file browser, click the Browse icon (the Browse icon).

  5. Click OK.

    Installing Go SDK
Last modified: 08 April 2025