GoLand 2020.1 Help

Release notes for GoLand 2020.1

Go Modules: fetch missed dependencies and remove unused dependencies

You can fetch missed dependencies and remove unused dependencies in the go.mod file.

For more details, see Fetch dependencies.

Go Modules: notifications about replacements of local paths in the go.mod file

GoLand displays a notification before you commit your changes if you replaced local paths in the go.mod file. This might help you to avoid situations when these replacements are committed by mistake.

To enable the feature, you must select the Perform code analysis checkbox in the Commit dialog settings.

Go Modules: GOPROXY, GOPRIVATE, GOSUMDB, GONOPROXY, and GONOSUMDB

Without leaving GoLand, you can set the following environment variables: GOPROXY, GOPRIVATE, GOSUMDB, GONOPROXY, and GONOSUMDB.

Set environment variables from GoLand settings

Go support: support of embedding overlapping interfaces in Go 1.14

When you describe different aspects of a type using overlapping interfaces, GoLand does not report duplicated methods as errors.

Go 1.14rc supports embedding overlapping interfaces

Before Go 1.14, you could not add the String() method to the Employee interface because the String() method is already defined in the Person interface. In the following example, you can see how Go 1.13.4 treats overlapping interfaces.

Go 1.13.4 does not support embedding overlapping interfaces

Go support: automatic vendoring mode in Go 1.14

In Go 1.14 RC, vendoring mode is enabled automatically if the module root contains the vendor directory. Now automatic vendoring mode is a built-in Go feature. Starting from Go 1.14 RC, GoLand also enables automatic vendoring mode by default. You cannot change this setting.

Automatic vendoring mode in Go 1.14

For earlier Go versions, GoLand still has the Enable vendoring support automatically checkbox. If you add the vendor directory to the module, the IDE uses it. If you remove it, GoLand uses the global Go Modules cache.

Automatic vendoring mode in Go 1.13 and earlier versions

Go Debugger: profiler labels are supported

Since Go 1.9, you can record additional information to provide more context about the execution path. You can record any set of labels as a part of the profiling data and use these labels later to examine the profiler output.

For example, you have a queue handler that processes events created somewhere. The handler can set labels to identify where these events were created.

During debugging and core dump analysis, the context information might be helpful. For example, you can use this information to find a particular goroutine more easily.

Go Debugger: profiler labels are supported

Code completion: handling errors with 'if err != nil { ... }'

When you type if inside a function, you can choose if err != nil { ... } to automatically complete your code.

Read more about code completion in Code completion.

Code completion: handling errors with 'if err != nil { ... }

Code completion: for interfaces and structs

When you type the type keyword, GoLand suggests you to auto-complete with type, type ... interface, type ... struct.

Read more about code completion in Code completion.

Code completion: for interfaces and structs

Code completion: improved behavior of the Fill Fields action

The Fill Fields action now adds spaces after colons when formatting rules require it. Also, the comma is added at the end of the statement in composite literals.

Read more about code completion in Code completion.

Code completion: improved behavior of the Fill Fields action

Code completion: place cursor after the closing bracket in maps

When you define a map, code completion places the cursor after the closing bracket after you complete a key type.

Read more about code completion in Code completion.

Code completion: place cursor after the closing bracket in maps

Code completion: a pointer to struct initializer is suggested in the SmartType completion

When you press Ctrl+Shift+Space to invoke the SmartType completion, GoLand suggests you a pointer to struct initializer in auto-completion.

Read more about code completion in Code completion.

Code completion: a pointer to struct initializer is suggested in the SmartType completion

Code completion: compatible types in assertions and type switch cases in the SmartType completion

When you invoke the SmartType completion by pressing Ctrl+Shift+Space, you see compatible types in assertions and type switch cases at the beginning of the suggestion list.

Read more about code completion in Code completion.

Code completion: compatible types in assertions and type switch cases in the SmartType completion

Code completion: names for the current package declarations in comments

You can invoke сode сompletion by pressing Ctrl+Space to see names for the current package declarations. Also, code completion includes parameter names for functions and methods.

Code completion: list of suggestions for possible pointers

You can invoke SmartType by pressing Ctrl+Shift+Space to see a list of suggestions for possible pointers.

Show names for the current package declarations in comments

Code completion: local variables and zero values in suggestions for the return statement inside a function

If the caret stays after the return keyword inside a function, code completion suggests local variables and zero values even if they result in an error.

Code editing: add parentheses around return types after the comma in a multi-value return

GoLand adds parentheses around multiple return types automatically. Parentheses are added automatically. GoLand adds parentheses as you enumerate return values in a function signature.

Code inspections: locks erroneously passed by value

The Checks for locks erroneously passed by value inspection detects situations when you copy a value that contains a lock. It might be a type that implements sync.Locker like sync.Mutex or sync.WaitGroup.

Locks erroneously passed by value

Code inspections: a warning about incorrect uses of uintptr to unsafe.Pointer

The code inspection Invalid conversions of uintptr to unsafe.Pointer warns you about incorrect uses of uintptr to unsafe.Pointer to convert integers to pointers.

A warning about incorrect uses of uintptr to unsafe.Pointer

Code inspections: a warning that the argument, which is passed to store the result, is not a pointer or an interface

The code inspection Invalid conversions of uintptr to unsafe.Pointer warns you about incorrect uses of uintptr to unsafe.Pointer to convert integers to pointers.

A warning that the argument, which is passed to store the result, is not a pointer or an interface

Postfix completion: the .else template to check if the expression is false

The .else postfix template adds the if statement that checks if the expression is false.

Read more about postfix completion in Postfix code completion.

Quick-fixes: updates for the Create variable quick-fix

The Create variable quick-fix shows a hint with the expected type. Also, the quick-fix automatically provides the Initialize with zero value action. This action creates a full variable declaration with the expected type, instead of a short declaration.

Live Templates: added consts, vars, types, and imports templates

New live templates are added: consts, vars, types, and imports. For these templates, GoLand adds braces around the expression by default.

Read more about live templates in Live templates.

Live Templates: added consts, vars, types, and imports templates

Live Templates: added the fori template for 'for' loops

The fori template expands to for i := 0; i < ...; i++ { ... }.

Read more about live templates in Live templates.

Live Templates: added the fori template for 'for' loops

Refactorings: the Implement Methods action allows you to specify parameters omitted in the interface definition

With the Implement Methods action, you can specify parameter names even if they are omitted in the interface definition.

For more information about the Missing Methodsaction, see Implement missing methods.

Refactorings: Implement Methods allows you to specify parameters omitted in the interface definition

Refactorings: the in-place rename action

Prior to GoLand 2020.1, to rename an element, you invoke the Rename refactoring by pressing Shift+F6, type a new name for the element and apply it through code.

Starting from GoLand 2020.1, you can change the element name, invoke intention actions by pressing Alt+Enter and apply your change through code.

The in-place rename action

Refactorings: improved behavior of the Extract Method refactoring

Now when you extract a method or a function using the Extract Method refactoring, it keeps the original order of the parent function or method parameters.

go improved extract method refactoring

Performance: improved performance for Navigate to implementations and Navigate to Declaration or Usages

Navigate to implementations Ctrl+Alt+B and Navigate to Declaration or Usages Ctrl+B actions now work faster since they look for implementations in the project scope first. Search results display project elements before non-project elements instead of sorting them all alphabetically.

Refactorings: Implement Methods allows you to specify parameters omitted in the interface definition

Fonts: JetBrains Mono Font

The default font for GoLand is JetBrains Mono.

To configure colors and fonts, see Configuring colors and fonts.

Spell checker: Grazie is bundled

Grazie provides spelling and grammar checks for texts that you write in the IDE. It supports English, German, Russian, Chinese, and other languages. In GoLand, Grazie is bundled.

You can manage all installed plugins in your IDE. For more information about plugin management, see Manage plugins.

Color themes: the Default color scheme is restored

You can use the Default color scheme again.

To customize color schemes, see Customize a color scheme.

JetBrains Runtime: end of JBR8 support

GoLand uses JetBrains Runtime 11 (JBR11), and no longer distributes builds with JetBrains Runtime 8 (JBR8).

User interface: a new Commit tool window

The new commit tool window now incorporates the Local Changes and Shelf tabs. This tool window covers all commit-related tasks, like checking diffs, selecting files and chunks to commit, and entering a commit message. Commit is a vertical tool window located on the left, which leaves room for the entire editor to show the diff.

A new Commit tool window

User interface: Zen Mode

Zen Mode combines the Distraction Free Mode and the Full Screen Mode. To enable Zen mode, navigate to View | Appearance | Enter Zen Mode.

Find usages: looks for usages of interface methods by default

The Find Usages (Alt+F7) action looks for usages of interface methods by default. To find usages of the current method, press Ctrl+Shift+Alt+F7.

Editor: the LightEdit Mode

With the new LightEdit mode, you can open a file in the text editor window without creating or loading a project.

If GoLand is launched, the file is opened in it. If GoLand is not running, the file is opened in the LightEdit mode.

  • Command-line interface: see for more instructions on how to open a file, compare or merge files, and run code inspections.

Last modified: 17 March 2020