GoLand 2018.3 Help

Installing and launching GoLand

Installation requirements

Hardware requirements

  • 2 GB RAM minimum, 4 GB RAM recommended

  • 1.5 GB hard disk space + at least 1 GB for caches

  • 1024x768 minimum screen resolution

Software requirements

JRE 1.8 is bundled with the GoLand distribution. You do not need to install Java on your computer to run GoLand.

Windows

macOS

Linux

32-bit or 64-bit versions of Microsoft Windows 10, 8, 7 (SP1), or Vista (SP2)

macOS 10.8.3 or later
(only 64-bit systems are supported)

  • OS Linux (note that a 32-bit JDK is not bundled, so a 64-bit system is recommended)

  • KDE, Gnome or Unity desktop environment recommended

Download and install GoLand

To install GoLand

  1. Download GoLand for your operating system.

  2. Do the following depending on your operating system:
    • Windows installation:
      1. Run the *.exe file you've downloaded.

      2. Run the GoLand-*.exe file you've downloaded.

      3. Follow the instructions in the installation wizard.

    • macOS installation:
      1. Open the .dmg package that you've downloaded, and drag GoLand to the Applications folder.

      2. Open the GoLand-*.dmg package that you've downloaded, and drag GoLand to the Applications folder.

    • Linux installation:
        1. Unpack the goland-2017.3.tar.gz file you have downloaded to a different folder if your current Downloads folder doesn't support file execution:
          tar xfz goland-2017.3.tar.gz <new_archive_folder>

          The recommended installation location according to the filesystem hierarchy standard (FHS) is /opt. To install GoLand into this directory, enter the following command:

          sudo tar xfz goland-2017.3.tar.gz -C /opt/
        2. Switch to the bin subdirectory:

          cd <new archive folder>/goland-2017.3/bin
          For example,
          cd /opt/goland-2017.3/bin

        3. Run goland.sh from the bin subdirectory.

    Manage GoLand through Toolbox App

    Toolbox App is a control panel that allows you to manage all JetBrains developer tools, including GoLand, as well as your projects, from a single point of access. It lets you launch the IDEs, maintain different versions of the same tool, install updates and roll them back if needed. It also remembers your JetBrains Account and uses it to automatically log you in when you install and register new tools.

    1. Download Toolbox App.

    2. Launch the setup file.

    3. When the installation is complete, accept the JetBrains privacy policy and sign in to your JetBrains Account.

    Now you can manage existing tools, install new tools, and download updates:

    go toolbox

    Update GoLand

    1. Download the latest version of GoLand.

    2. Launch the setup as described in Download and install GoLand.

    3. Choose whether you want to uninstall the existing GoLand version together with its settings, caches and local history and follow the instructions of the installation wizard.

    Run GoLand for the first time

    Import GoLand settings

    When you start GoLand for the first time, or after you have upgraded it from a previous version, the Complete Installation dialog opens where you can select whether you want to import the IDE settings.

    If this is your first instance of GoLand, choose the Do not import settings option.

    Create a workspace and start a project in GoLand

    After you have completed the initial GoLand configuration, the Welcome screen appears.

    The GoLand welcome screen

    Set up a workspace

    Before you start creating or importing your GoLand project, make sure you have done the following:

    1. Created a workspace where you keep projects.

      Use the following layout:

      • work
        • bin

        • pkg

        • src
          • github.com
            • user_name
              • project1

              • project2

    2. Downloaded Go distribution.

    3. Defined the environment variable GOPATH that points 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.

    Create a new project

    1. Click Create New Project on the Welcome screen.

    2. If the workspace is set up then GoLand will suggest you to create a project in the src subdirectory. Specify the name of your project in the Location field, the Go SDK (GOROOT) and click Create. GoLand creates a project in the workspace and the appropriate Go settings.

      Create a new project

    Open an existing project

    1. On the Welcome screen click Open and select the project directory. If your project is not inside the created workspace, move the project into your workspace first.

    2. When you open your project GoLand automatically tries to locate SDK (GOROOT). If GoLand cannot find GOROOT, the appropriate message with a link will appear suggesting to configure the Go SDK.
      Click the suggested link and specify the location of the Go distribution. After you set SDK, wait until GoLand finishes indexing the workspace.

    Attach a directory to an already-opened project

    You can attach a directory to an already-opened project. For example, when you need to open several projects in a single GoLand instance as you want.

    1. Navigate to File | Open.

    2. Navigate to the folder with the project that you want to attach.

    3. Click Open.

    4. In the Open Project dialog, click Attach.

    Attach a directory to an already-opened project

    Detach the attached directory

    In settings (Ctrl+Alt+S), navigate to Go | Project structure. In the pane with the project structure, click the Remove Content Entry icon (the Remove Content Entry                      icon).

    Detach the attached directory

    Run applications

    You can quickly create and run a Go application.

    1. In the Project tool window, right-click the project.

    2. From the context menu, select New | Go File.

    3. In the dialog that opens, specify the name of your application and select Simple Application from the Kind drop-down list.
      GoLand creates an executable application.

    4. In the editor add code and click the The Run icon icon in the left gutter or press Ctrl+Shift+F10 to run the application. The result is displayed in the Run tool window.

    Run a program

    To run a Go code, you need to adjust your run configuration or create a new one. You can manage your run configurations in the Run/Debug Configurations dialog.

    1. On the main menu, select Run | Edit Configurations.

    2. In the Run/Debug Configurations dialog, click The Add icon and from the list that opens, select the appropriate configuration.

      • The Go Build type is equal to go build command.

      • 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 run Go App Engine applications. Note, it requires your Go module to use a Go AppEngine SDK.

    3. Specify the run configuration options. You can also specify Before Launch options, for example, you can add a Go command that you want to run before executing the created configuration. Click OK.

    4. On the main menu, select Run | Run < configuration_name> or press Ctrl+Shift+F10.

    Change the GOPATH or the GOROOT settings

    1. Press Ctrl+Alt+S to open the Settings/Preferences dialog.

    2. From the options on the left, click GO and depending on the settings you want to change, select either GOPATH or GOROOT.

    3. On the GOROOT settings page, you can change the GOROOT location or specify a new version of the downloaded Go SDK.
      On the GOPATH settings page, you can change GOPATH global and project-level settings. If you'd like to use a GOPATH different from the one specified in the environment variable, clear the option Use GOPATH that's defined in system environment and specify the one you want.

    Register GoLand

    To try and evaluate GoLand, you can download and install its trial version for free. The trial version is available for 30 days, whereupon you need to obtain and register a license.

    1. Do one of the following:

      • On the Welcome screen, click Configure | Manage License

      • On the main menu, select Help | Register

    2. Select how you want to register GoLand:

      Option

      Description

      JetBrains Account

      Register using the JetBrains Account.

      For more information, see What is JetBrains Account?

      Activation code

      Register using an activation code.

      License server

      Register using a License Server.

      To override the URL of the system proxy during initial GoLand startup, use the -Djba.http.proxy property, which can be added as a JVM option.

      When performing silent install or managing GoLand installations on multiple machines, you can set the JETBRAINS_LICENSE_SERVER environment variable to point the installation to the license server URL.

    If you have plugins that require a license, then instead of the License Activation dialog, open the Licenses dialog by clicking Help | Licenses from the main menu.

    The Licenses dialog

    The Licenses dialog contains a list of licenses and shows their states:

    • Expired: Renew your license to continue.

    • Grace period: You have several days until the license expires.

    • Evaluation period: Use without an active license.

    • Active license: Use until the expiry date.

    To configure a license, click the Edit button, which opens the License Activation dialog.

    Location of GoLand settings, plugins, and logs directories

    After you have installed GoLand, its default location depends on your operating system.

    Operating system

    Location

    Windows Vista, 7, 8, 10

    c:\Users\UserName\.Goland<version>\

    Windows XP

    c:\Documents and Settings\UserName\.Goland<version>\

    Linux and other Unix systems

    GoLand directory starting with dot is located in your user home directory:
    ~/.<Goland><version>

    Mac OS X

    Each created subdirectory has its own location:
    Configuration (idea.config.path): ~/Library/Preferences/Goland<version>
    Caches (idea.system.path): ~/Library/Caches/Goland<version>
    Plugins (idea.plugins.path): ~/Library/Application Support/Goland<version>
    Logs (idea.log.path): ~/Library/Logs/Goland<version>

    If you want to override the default settings, refer to the support article.

    Install GoLand as a snap package on Linux

    You can install GoLand on Linux as a self-contained snap package. Since snaps update automatically, your GoLand installation will always be up-to-date.

    GoLand is distributed via two channels:

    • The stable channel includes only stable versions. To install the latest stable release of GoLand, run the following command:

      $ sudo snap install goland --classic
    • The edge channel includes EAP builds. To install the latest EAP build of GoLand, run the following command:

      $ sudo snap install goland --classic --edge

    When the snap is installed, you can launch it by running the goland command.

    To list all installed snaps, run sudo snap list. For more information, see the Snapcraft documentation.

    Last modified: 6 February 2019

    See Also