GoLand 2023.1 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

Intention actions: an ability to implement unexported interfaces

The Implement interface intention action now works for unexported interfaces.

To invoke the Implement interface intention action, click the type and press Ctrl+I.

Intention actions: conversion between different kinds of string literals

You can quickly convert strings that are surrounded by backticks to double-quoted ones, and vice-versa.

To perform this conversion, press Alt+Enter and select Convert double-quoted string to raw string.

Conversion between different kinds of string literals

Refactorings: the Rename refactoring for generic receivers

When you rename a generic struct, the Rename refactoring (Shift+F6) suggests changing the receivers accordingly.

Rename refactoring for generic receivers

Intention actions: preview of intention actions and quick-fixes

In the previous release, we enabled the Intention Preview functionality by default. This feature lets you instantly see how your code will be altered once you apply the IDE’s suggestions.

It is now possible to preview a wider range of intention actions and quick-fixes:

  • Introduce local variable

  • Create variable/global variable

  • Create constant/global constant

  • Create field

  • Merge declaration up

  • Delete all unused parameters

The preview appears when you open the list of available intention actions and hover an option.

You can disable the preview feature by pressing Ctrl+Q while the list of intention actions is open, and it will remain disabled until you turn it back on in the same way.

preview of intention actions and quick-fixe

Intention actions: simplified conversion of integers to strings

To convert an integer to a string by using the strconv.Itoa() call, click the value, press Alt+Enter, and select Convert integer to string using strconv.Itoa() call.

simplified conversion of integers to strings

Find usages: the Call group in Find Usages

The Call group for function calls is showed in Find Usages (Alt+F7).

Call group in Find Usages

Running code: run scratch files with non-standard-library packages

You can run scratch files with non-standard-library Go dependencies.

When you copy your code from a project file to a scratch file and press the Run button, GoLand creates a Run configuration with the -overlay flag. This flag is used with a JSON file that maps file paths to go.mod and go.sum in your original project.

Run scratch files with non-standard-library packages

Editing: remove leading spaces from Go directives

GoLand has an inspection and a quick-fix that will help you to detect and remove leading spaces in Go directives like //go:embed.

Remove leading spaces from Go directives

Editor: custom RegExp-based inspections

You can now use regular expressions to create your own search and replace inspections. These inspections can be especially useful for highlighting style-based or formatting-based problems.

Open settings by pressing Ctrl+Alt+S, go to Editor | Inspections and press the Add icon (The Add button). Select Add RegExp Search Inspection… from the list and you will be directed to a dialog where you can set up your new inspection. Select the desired language, use hints from the panel on the left to build a RegExp, and designate the required replacement. You can also specify how you want the IDE to highlight them in the project.

custom RegExp-based inspections

Links to the Go Playground include the version parameter if you choose the dev or previous versions.

version parameter in shared links to the Go Playground
Last modified: 09 March 2023