CodeGym /コース /Go SELF /Go 1.25, SDK and GoLand setup

Go 1.25, SDK and GoLand setup

Go SELF
レベル 5, レッスン 2
使用可能

1. How does your code work?

Before installing tools, it is important to understand how code is executed in Go. If you have previously studied languages such as Java, Kotlin, or C#, you know that their code is first turned into intermediate bytecode, which is then executed by a special virtual machine (JVM, CLR).

In Go, the approach is fundamentally different. The Go compiler converts your source text directly into machine code (native binary), specific to a particular operating system and processor architecture (Windows/x64, Linux/ARM, etc.).

        graph LR
        A[Your code .go] -->|Go compiler| B[Machine code]
        B -->|Build| C[Executable binary file]
        C -->|Run| D[Operating system]
        style C fill:#f9f,stroke:#333,stroke-width:2px
    

So where is the garbage collector?
Go is a language with automatic memory management. The Garbage Collector, the goroutine scheduler, and other service mechanisms form the Go Runtime. During compilation, this Runtime is simply "embedded" inside your final binary file. That is why Go programs run fast and do not require additional runtime environments to be installed on the server for execution.

2. What are Go SDK and GOROOT?

To turn source code into an executable file, your IDE needs a set of tools — Go SDK (often called Go toolchain).

Go SDK is a directory on your computer that contains:

  • Utilities for compilation and building go build, go run.
  • Formatting and testing tools gofmt, go test.
  • Standard library. Source code of packages fmt, strconv, math and hundreds of others.

The root folder where Go SDK is installed is called GOROOT in the language's terminology. The IDE uses GOROOT as the "source of truth". If the SDK is not connected, the IDE does not understand the syntax of the current language version, and an attempt to write import "fmt" is underlined in red, because the environment does not know where to look for that package.

3. Installing JetBrains GoLand

Official JetBrains website: https://www.jetbrains.com/go/download/

On the download page, the site will detect your OS automatically. Remember that you are downloading the full-featured version, which can be used during the trial period or with a student license.

Installing on Windows

  1. Download the .exe installer (choose the x64 or ARM64 processor architecture).
  2. Run the installer. In the Installation Options step, it is recommended to select the following items:
    • Create Desktop Shortcut: create a shortcut on the desktop.
    • Update PATH variable: add the IDE path to system variables (useful when working with the terminal).
    • Update Context Menu -> Add "Open Folder as Project": adds a convenient option to open any folder as a project via the right mouse button.
  3. Wait for the installation to finish.

Installing on macOS

  1. Download the .dmg file. Attention: choose the correct chip!
    • Apple Silicon M1, M2, M3... — for modern Macs.
    • Intel — for older models.
  2. Open the file and drag the GoLand icon to the Applications folder.

Installing on Linux

  1. Download the .tar.gz archive.
  2. Unpack the archive into a convenient directory, for example, ~/programs/goland.
  3. Go to the bin folder and run the script: ./goland.sh
  4. For convenience, you can create a shortcut through the IDE's own menu: Tools -> Create Desktop Entry.

4. First launch and setup

After installation, the IDE will offer to import settings from previous versions. If you are installing the development environment for the first time — choose Skip import.

After you choose the import settings, the license management window will open.

To start working without purchasing a paid subscription, go to the Start trial tab and click the blue Start Free 30-Day Trial button.

To activate the trial period, you will need a JetBrains account. If you do not already have an account, the system will redirect you to the site to create one. Complete the short registration, sign in to the IDE with the created profile, and the 30-day license will be activated successfully.

Welcome screen

After activation, the updated GoLand welcome screen will open. The interface here is logically divided into several areas:

Welcome to GoLand start screen
  • Left panel - Projects and Files. The main menu for starting work. Here you can open a folder with existing code (Open...), create a project from scratch (New...) or clone a repository from GitHub (Clone Repository...). Below that, a list of all your recent projects will be formed for quick access.
  • Right panel - Welcome to GoLand. A space with quick access to popular environment tools (Terminal, Docker, Database, and plugins), as well as a banner with information about "What's New in Go" updates.
  • Bottom panel - Quick settings. Pay attention to the lower part of the screen. Very convenient selectors are located there. In one click, you can change the IDE color palette (Theme, for example to Islands Dark) and choose a convenient keyboard shortcut layout (Keymap).

Settings Customize

All detailed customization of the appearance and fonts is located in a single global configuration window.

Click the ☰ icon (in the upper-left corner of the window) and choose File(Windows) or Golang(macOS).

In the menu of the opened window, go to: Settings/Preferences → Appearance & Behavior → Appearance.

Appearance settings window in GoLand

Here you can configure the development environment in detail:

  • Theme: choose the interface color theme. You can check Sync with OS so that the theme changes together with the system settings.
  • Zoom: scaling of all IDE elements. Note the hint nearby — you can quickly change the scale during work with the keyboard shortcut Alt+Shift+= (increase) and Alt+Shift+- (decrease).
  • Use custom font: in the Accessibility section, you can enable this option to change the system font of the interface and its size.

5. Documentation — your main helper

JetBrains is known for writing excellent guides for its tools. We strongly recommend checking the official GoLand documentation.

It contains a huge number of clear screenshots, GIFs, and short tutorial videos. It is very useful to "click around" these materials in your free time instead of scrolling through the TikTok feed.

The development environment is now installed and activated. In the next lecture, we will create our first project, download the Go compiler directly through the GoLand interface, write an entry point, and learn how to run console programs.

1
タスク
Go SELF, レベル 5, レッスン 2
ロック未解除
ブースターの加速
ブースターの加速
1
タスク
Go SELF, レベル 5, レッスン 2
ロック未解除
ゼロまでの会計
ゼロまでの会計
1
タスク
Go SELF, レベル 5, レッスン 2
ロック未解除
ノイズセンサー
ノイズセンサー
1
タスク
Go SELF, レベル 5, レッスン 2
ロック未解除
コマンド端末
コマンド端末
コメント
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION