What's New in GoLand

GoLand 2020.1 brings a variety of upgrades for Go Modules support, as well as code-editing features that require little to no interaction from the user and an expanded code completion family.

On top of that, there are new code inspections, quick-fixes, and other improvements, such as the new LightEdit mode, which lets you open a file in the text editor without creating or loading a project, intelligent spelling and grammar checks, and new features for web development and working with databases.

Prefer to learn interactively instead of by reading about it? Complete the Features of GoLand 2020.1 tutorial inside the IDE.

Go Modules Improvements

Configuring GOPROXY with automatically suggested by GoLand choice between 'direct' and 'off' values in the new 'Environment Variables' dialog.

Go 1.13’s environment variables GOPROXY, GOPRIVATE, GOSUMDB, GONOPROXY, and GONOSUMB are now supported.

Configure their default values using the Go Modules projects template. Simply click the Browse icon in the Environment field to open the new Environment Variables dialog.

Code completion for 'replace' keyword, dependency name, and path for the replacement in action.

Code completion for go, module, require, replace, exclude keywords, dependencies’ names, and replacements with local paths is available for go.mod file.

GoLand suggests importing a package.

Rename and Move refactorings are also in business. When you rename or move directories referenced by replace statements, GoLand will change the path in the go.mod file accordingly.

Using Find Usages to find where the directory is used in the go.mod file, and navigate to its source.

Now you can also call up Find Usages via the Project View to explore where the path to a particular directory is used in the go.mod file.

GoLand highlights unused and missing dependencies and suggests removing and fetching them using quick-fixes via Alt-Enter.

In GoLand 2020.1 you can fetch missing dependencies and remove unused via Alt-Enter.

GoLand notifies that commit include the go.mod file with replacements to local paths.

Last but not least, the new version will show a notification before you commit if there are replacements with local paths, so that you don’t commit them by accident.

Code Completion features you don’t need to learn how to use

Completing error-handling pattern by typing 'if' inside the function.

GoLand 2020.1 will suggest if err != nil { ... } to complete an error-handling pattern. Just type if inside the expression.

Declaration of 'struct' and 'interface' using code completion.

Define struct and interface types faster simply by typing the type keyword or struct and interface.

'Fill Fields' adds spaces after colon.

The Fill Fields action adds spaces after colons when required by the formatting rules. It also adds a comma at the end of the statement in declarations of composite literals.

GoLand moves the cursor to behind the closing bracket.

Now, when you are working with maps, code completion moves the cursor to behind the closing bracket after you complete a key type.

GoLand provides suggestions to complete local variables in the return type of the function.

For the return type of the function, completion provides suggestions for local variables and zero values that will be appropriate for the corresponding return value type.

Smart Code Completion (Ctrl+Shift+Space)

GoLand suggests a pointer to struct initializer.

Smart Code Completion suggests a pointer to struct initializer.

GoLand suggests compatible type in assertion.

It also suggests compatible types in assertions and type switch cases first.

GoLand suggests the type of the assigned variable in assertion.

In type assertion, it offers the type of the assigned variable.

GoLand provides a list of possible pointers in the expression via 'Smart Code Completion'.

Finally, it provides a list of suggestions for possible pointers in the expression.

Basic Code Completion (Ctrl+Space)

GoLand completes the name of function in the comment block.

Please welcome Basic Code Completion for comments, which makes writing documentation a lot easier! It suggests names for the current package declarations and parameter names for functions and methods.

GoLand suggest conversions in the expression.

Besides that, Basic Code Completion will suggest literals and conversions.

Code Editing

GoLand adds parentheses around 'int' type after typing the comma to add next return type.

GoLand 2020.1 adds parentheses around return types after the comma when writing a signature of a multi-value return function.

GoLand escaped double-quotes after pasting the text in a string literal.

When you paste some text in a string literal, the IDE escapes double-quotes.

To learn more about features that work without you having to do anything, read GoLand Editing Features You Didn’t Know About article.

Go 1.14 support

Difference between GoLand 2019.3 and 2020.1 in terms of overlapping interfaces support.

Support for overlapping interfaces

Go 1.14 has added support for embedding overlapping interfaces, and so have we! When you describe different aspects of a type using overlapping interfaces, GoLand will not report duplicated methods for them as errors.

New settings in 'Go Modules' section.

Automatic vendoring mode

Vendoring mode is enabled automatically in Go 1.14 if the module root contains a vendor directory. For GoLand 2020.1, we’ve decided to implement similar behavior for Go versions 1.13 and earlier. The IDE will automatically resolve imports to the vendor/ folder if it is present in the module.

Debugger updates

Going through goroutines with profiler labels in the 'Debug' window.

Profiler labels support

To help you more easily distinguish between goroutines during debugging or core dump analysis, we’ve added profiler labels to them.

If you’d like to learn more, read this article: How to Find Goroutines During Debugging.

Choosing predefined macros in new 'Macros' dialog for 'Program arguments' field in 'Run/Debug Configurations'.

Macros support

Now it’s possible to use macros as parameters to run or debug your application. In the Run/Debug Configurations dialog, click + in the Go Tool or Program arguments fields to open the new Macros dialog with the list of available macros to use.

In addition, you can now store the configuration file in the project. Select the Store as project file option at the top of the Run/Debug Configurations dialog.

Postfix Completion

'.else Postfix template in action.

The .else Postfix Completion template quickly adds an if statement to check if the expression is false.

Quick-fixes

Converting Println to Printf

Change a non-formatting call to a formatting one in no time, by pressing Alt+Enter.

'Create variable’ suggests completing an expression with an expected for it type.

The Create variable quick-fix now shows an expected type hint to make it easier to enter the right value.

Code inspections

GoLand warns about invalid calls of pointer methods on non-pointer receivers and provides a quick-fix for that.

This new code inspection warns you about invalid calls of pointer methods on non-pointer receivers and offers a quick-fix.

GoLand warns about possible misuse of unsafe.Pointer.

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

GoLand warns that an argument in 'Unmarshal' function mast have a pointer type.

The inspection Unmarshal is called with incorrect argument analyzes calls to json.Unmarshal and similar functions of encoding/json, encoding/xml, and encoding/gob packages.

GoLand warns that the argument must have a pointer type.

The Locks mistakenly passed by value code inspection helps you avoid accidentally copying a value that contains a lock.

Live templates

Declaration of 'var' and 'consts'.

We’ve added new templates to help you quickly create groups of declarations. These include consts, vars, types, and imports. When you use one of these templates, GoLand will add braces around the declaration names.

The 'fori' template in action.

The fori template inserts the boilerplate code for the classic for-loop.

Refactorings

The 'Extract Method' keeps the original order after the performing.

The Extract Method refactoring keeps the original order of the parent function and method parameters.

'Rename' offers to rename usages via Alt+Enter.

The Rename refactoring now detects the renaming of a declaration automatically. This means that when you rename a declaration manually, the IDE will show a gutter icon that will offer to rename all its usages.

Navigation

'Find Usages' shows usages of interface methods.

Navigate to implementations (Ctrl+Alt+B) and Navigate to Declaration or Usages (Ctrl+B) now show results from the current project first.

Also, the Find Usages (Alt+F7) action now always looks for usages of interface methods by default. To find usages of the current method as before, use Alt+Shift+Ctrl+F7.

VCS Improvements

New 'Commit' tool window with the diff in the editor.

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 side of the screen, which leaves room for the entire editor to show the diff.

The 'Branches' popup

Improved Branches popup

The Branches popup has been reworked in several ways:

  • We’ve added an explicit search field that enables you to look for existing remote and local branches.
  • Now you can use the Refresh button to update the existing remote branches.
  • Incoming (blue) and outgoing (green) commit indicators have been added to the status bar.
'Rebasing Commits' window

Interactively Rebase from Here dialog

We have substantially reworked Interactively Rebase from Here. This is a dialog that allows you to edit, combine, and remove your previous commits in order to make your commit history more linear and comprehensible.

To invoke this dialog, go to the Log tab of the Git tool window, select the oldest commit in the series of commits you want to edit, right-click it, and choose Interactively Rebase from Here.

Databases updates

The results are displayed the code editor.
  • Run script files and code snippets using Run configurations. This allows you to run several files at once, reorder them, add new ones, and run other programs or configurations before launch.
  • Now you can see the results in the code editor. This option is disabled by default. To turn it on, go to Settings/Preferences | Database | General | Show output results in the editor.
  • Create a configuration of the SSH tunnel and use it in many data sources or even in projects.
  • We've added the ability to export data to an Excel file.
  • Also, you can choose your preferred data format in the extractor drop-down.

Web Development

GoLand offers to convert the existing code to optional chaining and/or nullish coalescing via Alt+Enter.

New smart intentions and inspections for JavaScript and TypeScript

Use new smart intentions and inspections (Alt+Enter) to save yourself some time when coding! For example, you can now quickly convert the existing code to optional chaining and/or nullish coalescing, the syntax introduced in the latest versions of JavaScript and TypeScript.

The Documentation popup shows the type of symbol, and where the symbol is defined.

More helpful quick documentation

For JavaScript and TypeScript, the Documentation popup now shows more useful information, including details about the type and visibility of the symbol as well as where that symbol is defined.

More changes

An opened file in the text editor without creating or loading a project via new 'LightEdit Mode'.
  • JetBrains Mono, a new font from JetBrains, is available by default. To learn more about the font, please visit this page.
  • Grazie, a plugin that provides intelligent spelling and grammar checks for text that you write in the IDE, is bundled by default.
  • The new LightEdit Mode allows you to open a file in the text editor without creating or loading a project. To try this new functionality out, you will first need to create a command-line launcher from Tools | Create Command-line Launcher, as described here (if you’re using the JetBrains Toolbox App, the steps will be slightly different). For more detailed instructions on how to open a file, compare/merge files, and even run code inspections, see this web help section.
  • We’ve added the new Zen Mode, which gets rid of possible distractions and helps you focus completely on your code. In its essence, this mode combines the Distraction Free Mode and the Full Screen Mode. To enable it, go to View | Appearance | Enter Zen Mode, or choose it from the Quick Switch Scheme popup (Ctrl+` | View mode | Enter Zen Mode).
  • External Documentation now leads to https://pkg.go.dev instead of https://godoc.org.
  • We’ve brought back the Default color scheme, albeit with a new name, Classic Light.