IntelliJ IDEA 2020.1 Help

Create a new project

If you plan to work on a project that does not require complex dependency management, consider creating the Go project (File | New | Project). Otherwise, create the Go modules project or enable Go modules in your current project. The list of projects

Without Go modules, you need to store your source code under the GOPATH directory (a Go workspace). Also, you cannot install multiple versions of the same dependency package since the go get command downloads the dependency package to the same directory.

Create a Go project

  1. Select File | New | Project.

  2. In the New Project page, select Go.

  3. In the GOROOT field, specify the location of your Go installation. Usually, the location is defined automatically.

    To change or install a new version of Go SDK, click the Add SDK button and select Local to choose the Go SDK version on your hard drive, or select Download to download Go SDK from the official repository. For more information about installing Go SDK, see Installing Go SDK.

  4. (Optional) Toggle the Index entire GOPATH checkbox:

    • Checkbox cleared: project files and vendored packages are indexed. Packages from GOPATH are not indexed. Might improve the overall performance.

    • Checkbox selected: packages from GOPATH and project files are indexed.

  5. Click Next, specify a project name and click Finish.

    Download Go SDK

Installing Go SDK

Select a local copy of the Go SDK

Ensure that the provided path to the folder with Go SDK includes bin and src folders.

  1. In the New Project dialog, select Go.

  2. Click 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.

    Download the Go SDK

Download the Go SDK

  1. In the New Project dialog, select Go.

  2. Click the Add SDK button 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.

    Download the Go SDK
Last modified: 7 July 2020