GoLand 2022.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

Generics: support for the go:linkname directive

The go:linkname compiler directive is now supported. The Missing function body false-positive error has been fixed.

go:linkname directive

Go support: fuzz testing

If you click the green triangle icon in the gutter next to your fuzz test, you will see different options for running the test. If the test fails, the failing seed corpus entry will be written to a file and placed in your package directory in the testdata folder.

The path to this file will also appear in the console as a clickable link. If you click the link, the file will be opened in the IDE, and you will see a green triangle icon at the top of the file. Clicking on this icon will run go test with the failing seed corpus entry.

Go support: loong64 in the Arch list

Go 1.19 is introducing a new loong64 architecture.

loong64 in the Arch list

Go support: support of Append, Appendln, and Appendf

Go 1.19 introduces three new functions to the fmt package: Append, Appendln, and Appendf.

GoLand identifies formatting verbs inside strings in Appendf functions.

Append, Appendln, and Appendf

Performance optimization: stop scanning ~/go/pkg/mod/cache

When you work in GoLand, the IDE scans GOMODCACHE (~/go/pkg/mod) to suggest dependencies. GOMODCACHE includes a cache subdirectory that contains some metadata and other information that is not needed for GoLand to work correctly.

We decided to stop scanning the cache subdirectory. This folder can be fairly large, and we hope that excluding it from the scan will improve performance.

Build constraints: support for the unix build constraint

GoLand now supports the new unix build tag that matches any Unix or Unix-like system.

The unix build constraint

The following quick documentation features were implemented:

  • Tooltips for Go keywords.

    Tooltips for Go keywords
  • Documentation for channel types.

    Documentation for channel types
  • Report methods on both value and pointer receivers.

    value and pointer receivers
  • Improved quick documentation for iota.

    documentation for iota
  • Additional information when you initialize maps, arrays, slices, and structs.

    information when you initialize maps, arrays, slices, and structs
  • Documentation for type assertions.

    documentation in type assertions
  • Documentation for blank identifiers.

    Blank identifier
  • Documentation about empty interfaces.

    empty interfaces
  • Documentation about type aliasing and type definition.

    type aliasing and type definition

Generics: improvements

The following inspections were introduced:

  • Report unused type parameters.

    Report unused type parameters
  • Quick-fix to delete a type parameter with an empty parameter list.

    delete a type parameter with an empty parameter list
  • Report union of interfaces with methods. For more information about this limitation, see the issue #45346 in the golang repository on github.com.

    Report union of interfaces with methods
  • Completion for a type parameter when typing a method’s receiver.

    Completion for method receiver
  • Report usage of a type parameter as a constraint.

    usage of a type parameter as a constraint
  • Irregular usage of iota.

    Irregular usage of iota
  • Constants with the name iota collide with the builtin constant

    Reserved word used as name

User interface: the Merge All Project Windows action

For macOS users, GoLand has the ability to merge all opened project windows by turning them into tabs within a single window. To do this, go to Window | Merge All Project Windows.

User interface: font size indicator on zooming

To be able to zoom in with your mouse, open settings by pressing Ctrl+Alt+S and navigate to Editor | General, and select the Change font size with Command+Mouse Wheel in: for macOS or Change font size with Ctrl+Mouse Wheel in: for Microsoft Windows or Linux. Choose where you want this functionality to work: Active editor or All editors. You can also open the General settings window by clicking on the wrench icon that appears on the new indicator bar.

font size indicator on zooming

User interface: a description field for mnemonic bookmarks

GoLand has a description field in the Add Mnemonic Bookmark dialog so that you can add an optional description to your bookmark. To add a mnemonic bookmark, right-click the gutter next to the line you want to bookmark and select Add Mnemonic Bookmark. Or press Ctrl+F11.

description field for mnemonic bookmark

User interface: a progress bar for cloning a repository

The progress bar is shown right in the Projects list when you clone the repository.

The progress bar for cloning a repository

Editor: disable automatic block comment closure

To disable automatic block comment closure when you press Enter, open settings by pressing Ctrl+Alt+S and navigate to Editor | General | Smart Keys and clear the Close block comment checkbox in the Enter section.

Editor: faster access to code completion settings

You can now access code completion settings from the vertical ellipsis menu button in the code completion popup. The code completion settings are located in open settings by pressing Ctrl+Alt+S and navigate to Editor | General.

access to code completion settings

Editor: automatically detected SQL statements

SQL statements are now automatically detected and injected in every string literal that matches a certain pattern.

To find the patterns, edit them, and add your own, open settings by pressing Ctrl+Alt+S and navigate to Editor | Language Injections

automatically detected SQL statements

Running code: run anything

The Run Anything action allows you to quickly launch run/debug configurations, applications, scripts, commands, and tasks, as well as open recent projects. For more information about the action, see Run anything.

Run Anything

Quick-fixes: group multiple use directives

To group multiple use directives in a go.work file into one directive, press Alt+Enter and select Merge multiple 'use' directives into one.

 group multiple use directives
Last modified: 06 July 2022