GoLand 2025.1 Help

Developing Go SDK and contributing to Go

GoLand is a Go IDE that you can use to write Go code for your applications. But what if you want to work on the Go language itself and contribute to its development? This tutorial shows you how to configure the IDE for that purpose in just a few steps.

Step 1. Clone the Go sources

  1. On the Welcome screen, click Clone Repository.

  2. In the Clone Repository dialog, select Git from the Version control list.

  3. In the URL field, paste the following URL: https://go.googlesource.com/go.

  4. In the Directory field, specify the directory where you want to store the Go project.

  5. Click Clone.

  6. Open settings Ctrl+Alt+S and navigate to Go | Go Modules.

    Ensure that the Enable Go modules integration checkbox is cleared.

    The Go sources include go.mod files that are used for tests. To disable these tests, turn off Go Modules integration.

    Step 1. Clone the Go sources

Step 2. Compile Go

  1. In the Terminal tool window (View | Tool Windows | Terminal), navigate to the src directory by running: cd src.

  2. From the src directory, run the following command to compile Go:

    • ./make.bash for Linux and macOS

    • make.bat for Windows

    Step 2. Compile Go

Troubleshooting

Error

Possible solution

ERROR: Cannot find <path_to_go>. Set $GOROOT_BOOTSTRAP to a working Go tree >= Go <version>.

Open settings Ctrl+Alt+S and navigate to Tools | Terminal.

Click Browse (Browse icon) in the Environment Variables field and add this variable:

GOROOT_BOOTSTRAP = <path_to_go_sdk>

Set GOROOT_BOOTSTRAP

Step 3. Set the cloned Go project as Go SDK

To use the cloned Go source as your SDK, set the root directory as the Go SDK. This enables code completion, navigation, refactorings, and other IDE features.

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

  2. Click the Add SDK button Add SDK icon and select Local.

  3. In the file browser, navigate to the root directory of the cloned Go source and click Open.

  4. Click OK.

    Step 3. Set Go SDK

Step 4. Create a branch for your changes

  1. Go to Git | Branches and select New Branch.

  2. In the Create New Branch dialog, enter a name for the new branch and click OK.

Step 5. Run tests

After you have made your changes, run the tests that you created. You can also run all tests included in the Go source project.

  1. In the Terminal tool window (View | Tool Windows | Terminal), navigate to the src directory: cd src.

  2. From the src directory, run:

    • ./all.bash for Linux and macOS

    • all.bat for Windows

Step 6. Commit your changes

Once you have completed and tested your changes, you can commit them to your fork and create a pull request.

  1. Go to VCS | Commit Ctrl+Alt+K.

  2. Select the files you want to include in the commit.

  3. In the Commit Message field, describe the changes you made.

  4. Click Commit.

    Step 6. Commit changes

Step 7. Add a remote and push to your fork

Add a new Git remote pointing to your fork (for example, git@github.com:<your_github_account>/go.git). Then push your branch and open a pull request. For more details, refer to Creating a pull request from a fork on GitHub.

  1. Go to Git | Push.

  2. In the Push Commits dialog, click the origin link in the commit title.

  3. Click Define Remote.

  4. In the Name field, enter a name for your fork.

  5. In the URL field, enter the URL of your fork and click OK.

    Step 7. Add remote and push
Last modified: 14 April 2025