What’s New in GoLand

Call function in the Evaluate Expression dialog

Examine in detail what is going on inside your expression at any specific point in your program’s execution.

Note, that this feature relies on the experimental function call support feature from Delve and the Go Runtime.

If you encounter any bugs or issues with function calls support, please report them to our issue tracker.

Updated Darcula color scheme

GoLand 2019.2 adds variety to the semantic code highlighting in the Default and Darcula color schemes.

This will help you better understand your code and follow its logic faster. Easily distinguish package names from variables, built-in code constructions from your own ones, and type conversions from function calls. Methods’ receivers and functions/function calls now have their own colors, too.

As usual, change everything to your taste in Settings/Preferences | Editor | Color Scheme.

The debugger shows the results of String() method implementations in the Variables pane

The debugger now shows the results of simple String(), Error(), and DebugString() method implementations in the Variables pane. It supports methods with a single return statement without calls.

Presentation of time.Time and net.IP in the Variables pane

GoLand 2019.2 displays the value of struct derived from time.Time, time.Duration and net.IP types in a human-readable format in the debugger’s Variables pane.

Select decimal format in the settings

Choose how to display integer variables in the debugger by default: in binary, decimal, or hex format. Set the format in Settings/Preferences | Build, Execution, Deployment | Debugger | Data Views | Go.

Result of new number literals in the Console

GoLand 2019.2 supports number literals and signed integers as shift counts. These changes are related to the steps we’re making towards Go 2. Head to the official Go blog to learn more.

GoLand’s code highlighting will alert you to any mistakes, and it will correctly show you the output in the Console.

Read this article to learn more about the new Go 1.13 features and how GoLand 2019.2 supports them.

Using custom .forrev template

GoLand 2019.2 lets you create your own custom Postfix Completion templates.

Navigate to Settings/Preferences | Editor | General | Postfix Completion, click +, select Go, define your template, and choose the scopes where the template will be applicable.

To learn more about creating custom templates, see this article.

In addition, you can find new predefined Postfix Completion template — .aappend. It prepends an expression with a built-in append function call and assigns its result to this expression.

New quick-fixes in action

We have added many quick-fixes based on the Change Signature refactoring. For example, with the simple press of Alt+Enter, you can automatically infer and add a parameter to the function call, or add missing return parameters in a signature.

Extract Method extracts code with return statements

The Extract Method refactoring now handles code with return statements. If the code always exits via returns, it will be extracted as is. However, if it contains execution paths without returns, the extracted method will have an additional boolean flag as a return value. The flag will be used to perform an early return on the call side.

Code completion suggestions for a receiver member without a receiver

Code completion now provides suggestions for receiver members even if there’s no receiver. Receiver names like this or self are discouraged. As a result methods have different receiver names. This code completion feature allows you to ignore the difference.

Go Modules integration enables automatically

GoLand 2019.2 enables Go Modules/dep integration automatically when it detects that a project uses Go Modules or dep. Previously, it disabled GOPATH indexing and showed only a notification about enabling Go Modules/dep integration. We noticed that was not enough though, because it was easy to miss or ignore the notification and thus get a project in a semi-configured state.

If this doesn’t work for you, you can disable the integration manually in Settings/Preferences | Go | Go Modules (vgo) at any time.

Inspection warns about redundant type conversions

A code inspection called Redundant type conversions helps you keep your project more readable and neat. It warns you about redundant type conversions that can be omitted.

IDE warns about a non-negative integer constant in the editor

We’ve added validation of slice indices in composite literals! This means that the editor will warn you that your index must be a non-negative integer constant before you compile your project.

code highlighting, an inspection, and smart editing in action

Support for escape sequences in string literals is fully equipped with:

  • Code highlighting.
  • An inspection that will warn you about potential problems.
  • Smart editing that understands the location of escape sequences.
  • More precise spell-checking.

Also, formatting placeholders are now highlighted in a different color so you can more easily spot them in long strings. You can customize the color via Settings/Preferences | Editor | Color Scheme | Language Defaults | String | Escape Sequence | Valid. Or, for Go only, go to Settings/Preferences | Editor | Color Scheme | Go | String | Valid escape.

Using Fill Fields via code completion

It is now easier to fill the fields of structs. First, you can choose which fields you want to fill in a dedicated window. Second, generated values can now be edited. Finally, this action is now available via Code Completion.

Using Fill Fields via code completion

Extend Selection now extends the code in a semantically correct way, from a line to a block of code separated by empty lines (instead of selecting the whole method body).

New | File dialog

The New | File dialog has been turned into a popup with a list of all the possible options for a particular file type to create. Previously, you had to expand the list to choose an alternative, but now all the available options are immediately visible.

Plugins page

Now GoLand shows the plugin details right away, without any need to open the plugin’s detail pages one by one. We’ve added more options under the gear icon, so you can disable or enable all the downloaded plugins all at once. The Update button is now placed near the plugin name in the Installed tab. The Updates tab is gone as it isn’t necessary anymore.

Difference between an old Find tool window and the new one

In the Find tool window, we have grouped together some rarely used icons and removed others altogether.

Select Recently Viewed Files scope

New scopes such as Recently Changed and Recently Viewed Files, Files in Previous Search Result, and Selection are all now added to the Scope chooser. You will also be able to select the Data Sources scopes. In addition to this, we’ve added an ability to select a scope for Rename refactoring. Double press Shift+F6 to invoke the Rename refactoring window, and choose the scopes where the renaming will be performed.

Settings of Move Caret to Next Word action

The default behavior of the Move Caret to Next Word action in GoLand 2019.2 has changed: the IDE now moves the caret to the end of the current word. However, you can adjust it as you see fit. Go to Settings/Preferences/Settings | Editor | General and select where the IDE should place the caret: at the end of the word, at the beginning of the next word, or even between both boundaries.

File size, date and time of modification in the Project View

Toggle In-place Descriptions under the View menu to get a preview of the file size, and date and time modifications in the Project View.

File size, date and time of modification in the Project View

GoLand 2019.2 provides a way to commit directly from the Local Changes.

Now while working on a commit, you can browse through the source code, view the history for a specific file, view the diff for the file in the same area as the commit, or use the other features of the IDE.

To enable this functionality and commit from the Local Changes without a dialog, go to Settings/Preferences | Version Control | Commit Dialog and select the checkbox Commit from the Local Changes without showing a dialog.

Adding a file to .gitignore via context menu

GoLand correctly highlights all the ignored files and offers code completion suggestions for file and folder name. You can now quickly add a file to .gitignore using the context menu from the Local Changes tab of the VCS tool window: right-click it in the Unversioned files group and select Add to .gitignore.

Abort Cherry-Pick option via context menu

We've added an Abort Merge option that will be available in the Branches popup when there is an ongoing merge. This is the future many of us have dreamed of, where you don’t need to switch to the terminal anymore to abort things.

Select Hash column

Click on the eye icon to choose the columns to display in the Log tab, select the Show Columns item from the context menu and choose the columns you want to see: Author, Date, or Hash.

Path completion for Shell Script

GoLand 2019.2 provides support for shell scripts, including word and path completion, Quick documentation preview, and even text-based rename.

On top of that, we’ve added integrations with Shellcheck, and shfmt.

The debugger displays int as binary via View as action

With the Kubernetes plugin, GoLand 2019.2 provides editing support, code completion for keys and paths, many inspections, and the Rename refactoring. It will also let you navigate from a declared path to the associated packages or files in the project view for Kustomize resource files.

The services tool window with the file system of the running Docker container

Now you can view the file system of the running Docker container. The file system is displayed in the File tab of the Docker node in the Services tool window.

Propagate to destructuring declaration intention in action

With the new Propagate to destructuring declaration intention, you can replace an extra variable if it’s possible with another destructuring. To remove a destructuring completely, use the intention action called Replace destructuring with property or index access.

The IDE will now warn you if a boolean expression in a condition has some unnecessary parts and will suggest simplifying it.

Grouped and excluded dynamic usages in the Refactoring Preview tool window

When you rename a symbol in a JavaScript or TypeScript file, the IDE now groups together dynamic usages and, by default, excludes them from the refactoring. This makes the refactoring more accurate and gives you more control over what exactly should be renamed in the Refactoring Preview tool window.

Code completion for components

Using Vuetify or BootstrapVue in your Vue.js application? Code completion for components and their props from these and some other Vue component libraries is now more precise. This was made possible by a new approach we’ve adopted to work with these libraries in the IDE.