GoLand 2023.2 Help

Release notes

This section lists functionality added to GoLand in the current release. To view release notes for other GoLand versions, click the version switcher on the help site and select the version that you need.

Release notes

Go modules: automatic download of Go modules

GoLand has an auto-download feature for Go module dependencies. This new capability automatically downloads modules when a project opens and each time a change is made to the go.mod file. Although this feature is enabled by default for your convenience, it can be easily toggled off in settings (Control+Alt+S) under Go | Go Modules. This enhancement helps to prevent the red code issue that could occur in newly opened projects.

automatic download of Go modules

Refactorings: migration of function parameters and method receivers

GoLand has two new refactoring capabilities. The Migrate Function Parameter to Method Receiver refactoring tool allows you to transform functions into methods on a type. Conversely, the Migrate Method Receiver to Function Parameter allows the conversion of a type and its methods into separate functions.

Note that migration of a function parameter to a method receiver is impossible in cases where the first parameter is not a valid receiver type, like in the case of an interface type.

To clarify why the refactoring is not performed in such instances, GoLand displays a message explaining why the refactoring is impossible or undesirable.

migration of function parameters and method receivers

Code completion: enhanced completion for 'make' function

The make function invocation has type-aware completions, further assisting you in writing accurate code. We've also introduced checks to detect errors and redundant arguments in make functions. A quick-fix option has been added to remove any redundant arguments swiftly.

enhanced completion for 'make' function

Inspections: verification of 'make' function arguments

GoLand can detect errors and redundant arguments in make functions. There is also a quick-fix to remove redundant arguments, which you can access by pressing Alt+Enter.

Checks for ‘make’ function arguments

Settings: an option to disable vendoring

You can disable vendoring per project, which can be beneficial in specific scenarios such as monorepos containing vendor folders used by another language. This feature can be adjusted when creating a new project or anytime in settings (Control+Alt+S) under Go | Go Modules.

For more information, see Vendoring.

Keymaps: VS Code

For users familiar with the VS Code keymap, we've integrated it into the IDE. You can choose it in the Customize section on the Welcome screen or change the keymap in the settings (Control+Alt+S) under Keymap.

Code completion: improved completion for method expressions

When calling a method directly on a type (a method expression), GoLand now includes the receiver type as the first parameter in completion suggestions, enhancing the clarity of your code.

improved completion for method expressions

Generics: improved error messages

We've enhanced the error message for missing type arguments during type's instantiation. Now, GoLand specifically indicates the issue in the error message.

Generics: improved error messages

Code preview: Wrap Error Handling in Closure

We've introduced a preview feature for the Wrap error handling in a closure intention, allowing you to see the proposed changes before applying them. You can disable this feature by pressing Control+Q while the list of intention actions is open.

UI/UX: warning for redundant conditions in 'for' loops

To help optimize your code, GoLand now provides a warning message for redundant conditions in for loops, along with a quick-fix to remove these conditions efficiently.

UI/UX: improved menu on Windows and Linux

We've refined the behavior of the hamburger menu in the main toolbar for Windows and Linux. Clicking on the menu icon now displays elements horizontally over the toolbar. Additionally, you can now opt to transform this menu into a separate toolbar. Navigate to View | Appearance | Main Menu as a Separate Toolbar to access this feature.

Performance: improvements with new tool for generating shared indexes

To improve productivity, especially for teams working on large projects, we're introducing a new command-line tool for quickly building and uploading shared indexes. This tool streamlines the process of creating shared indexes, requiring a few simple steps instead of complex scripts. After downloading and unzipping the archive, execute the binary file from the command line, specifying the project path. The tool then configures an intellij.yaml file for your project. For further customization, refer to the scripts provided in README.md.

Intention actions for updating dependencies in go.mod

Now, when you access your go.mod file, GoLand will highlight any outdated dependencies. Hovering over the highlighted versions will allow you to employ a quick-fix to update a specific dependency.

Additional options are available to update all dependencies to either the latest patch or the most recent major version. If you prefer, there's also the possibility to update only direct dependencies.

These features are enabled by the Dependency update available inspection. We've also introduced two additional inspections:

  • Deprecated dependency: depicted with strikethrough text, this highlights deprecated dependencies.

  • Retracted dependency version: also shown with strikethrough text, this indicates retracted version numbers.

You can manage the settings of these inspections, including their scope and severity, by openning settings (Control+Alt+S) and navigating to Editor | Inspections | Go modules.

Last modified: 19 June 2023