Early Access Program Features

GoLand 2019.3 Turns Beta!

Our train of Early Access Program builds is quickly approaching its final destination. GoLand 2019.3 has reached the Beta milestone, so starting today we are focusing on polishing things up and getting the IDE ready for the release. Note that while the Beta is quite stable compared to our Early Access Program builds, it may still contain some kinks and glitches.

blog@2x-2

Your feedback is vital for us, so if you come across any bugs or peculiar behavior, please tell us using our issue tracker or Twitter, or ping us right here in the comments.

Download GoLand 2019.3 Beta

Performance

Since releasing GoLand 2019.2 this summer, we’ve been working hard to reduce the startup times, so that you don’t have to wait as long while the IDE prepares everything under the hood, displays the welcome screen, and indexes a project.

We have significantly reworked the first three phases: bootstrap, app initialization preparation, and app initialization. To determine the outcomes of these changes, we’ve measured the startup times of GoLand 2019.3 on different operating systems and compared the numbers with those for previous versions. To get accurate results, we used the same project everywhere, took three measurements of startup times, and calculated the means.

Startup-Perfomance

We will keep working on this, so you can expect even faster startup times in future releases.

Go Modules improvements

Great news: we are continuing to extend GoLand’s support for Go Modules projects. Version 2019.3 will provide syntax highlighting and navigation for go.mod files. Press ⌘+B on macOS or Ctrl+B on Windows/Linux on a specific dependency import path, and GoLand will navigate you to its sources in the Project View.

Also, in the Project View, Go Modules will be displayed with their full import path instead of just the last segment of it. The version of each Go Module will also be shown in a more muted font color than the import path, to help you easily distinguish between them.

go-modules-navigation

Debugger updates

Call Method of an Embedded Field in the Debugger

Evaluate Expression in the debugger now allows you to call a method of an embedded field directly.

evaluare-expression-update

Remote debugging with Mozilla rr

Now it’s possible to debug your applications remotely using Mozilla rr. Follow these steps:

  1. Collect an rr trace on the remote machine.
  2. Start the debugger on the remote machine like this:
    dlv –headless –api-version 2 -l localhost:2345 replay /path/to/trace/dir /path/to/binary
  3. Connect to it from the IDE as usual.

mozilla-rr

New quick-fixes

Handling unused parameters

For unused parameters, GoLand now highlights its name and type if both can be removed, or only the name if the type is used for implementing a method specification.

In the latter case, the IDE provides two quick-fixes for you to choose from: Delete parameter names or Rename to _. The same behavior is provided for functions that are used as a function type.

quick-fixes-for unused

Also, now you can remove all the unused parameters in one go. Press Alt+Enter and use the Delete all unused parameters quick-fix.

delete-all-unused-parameters

Create method/function if there is no call

GoLand 2019.3 will provide a quick-fix to create a missing function or method if there is no call. Just press Alt+Enter and choose Create method/function.

сreate-method-function-quick-fix

Refactorings

Change Signature

Change Signature always shows the types of parameters in the Parameters and Result parameters tabs. Select the new Reuse types checkbox to collapse consequence types in the Signature Preview.

You will also find two new intention actions, Reuse signature types which merges parameter definitions in a single declaration, and Expand signature types which adds types to each parameter via Alt+Enter.

change-signature

Move

The Move refactoring doesn’t rename package main files that contain a func main() declaration, so they remain runnable.

Extract Variable and Rename

Extract Variable and Rename are now better at suggesting names. For example, err is suggested for expressions of type error, ctx is suggested for context.Context, and so on.

exctract-variable

Improved Code Inspections behavior

In GoLand 2019.3, code inspections will be more focused. We’ve reduced the highlighting range of the detected issues in the code editor, which will help show the most relevant quick-fixes and intention actions for a particular piece of code when you invoke the context menu via Alt+Enter.

Also, the inspection Bool condition code (part of Declaration redundancy inspections) doesn’t warn you about using const booleans anymore.

Code Editing

Improved code folding for composite literals

GoLand 2019.3 will provide code folding for composite literals. Use the code folding toggles to fold or expand the code fragment, or press Ctrl+NumPad Minus/Ctrl+NumPad Plus on Windows or ⌘+NumPad Minus/⌘+NumPad Plus on macOS. To configure the default code folding behavior, go to Settings/Preferences | Editor | General | Code Folding.

code-folding-composite-literals

Syntax highlighting for reassignments in short variable declarations

Go allows using existing variables on the left-hand side of short var declarations. This means that two constructs that look the same can have different meanings. To make this easier to spot, we’ve added syntax highlighting for such reassignments.

syntax-highlighting-reassignments

Improvements for the rune literal lexer

We’ve improved the rune literal lexer in several ways:

  • GoLand doesn’t highlight a valid rune literal as an error after editing.
  • Parsing of invalid rune literals is more stable now.
  • GoLand provides a clearer and more concise error message stating why an expression is incorrect.

rune-literal

Enhanced Live templates

The Live templates for and forr now suggest relevant variable names. For example, names like i and index are suggested for an index; s, string, and line are suggested for a value.

The live template meth now provides code suggestions for receiver names.

live-templates

Search only in a selected area

Search only in a selected area when using the Find action (⌘+F on macOS and Ctrl+F on Windows/Linux). Simply select the piece of code you need in the editor and invoke the Find action – the IDE will then perform the search only in the selected area. To easily switch to searching within the whole file, press ⌘+F / Ctrl+F a second time, or alternatively toggle the In Selection option in the bar.

Find-action

Find in Path displays file extensions when using a file mask

Now when you search in the Find in Path dialog using a file mask, GoLand shows the file extensions in the search results accordingly. This makes it easier for you to distinguish between files with the same name but with different file extensions.

find-in-path-update

Enable Global File Watcher for every new project

Back in GoLand 2018.2, we added an option to share a file watcher configuration among different projects using the Project and Global options – this is called Global File Watcher.

However, you would have still needed to enable this watcher in each new project. Now, it’s possible to enable this watcher by default in every new project you create or open.

In the menu File, select Other Settings | Settings for new projects, then go to Tools | File Watchers, add a new global watcher, and then select the checkbox next to it to enable it in all new projects.

file-watcher-for-all-projects

VCS

Reworked Clone dialog

The Clone dialog is located under VCS | Get from Version control. Now you can log in from this dialog, or if you’re already logged in, the IDE will instantly preview the lists of all repositories grouped by accounts or organizations.

reworked-clone-dialog

Databases

MongoDB support

GoLand 2019.3 will provide basic support for MongoDB. Now you can:

  • View collections and fields in the database explorer.
  • Open any collection or observe the query result. It’s also possible to sort by columns or filter the values.
  • Run queries and get the results. Select a statement and run it by pressing Ctrl/⌘+Enter or by using the Play button on the toolbar.

database_view

Search with Google for connection errors

It’s now easier to explore connection errors. When a connection fails, you can just click the dedicated button in the IDE to search Google for your information about the error.

Search-with-Google-connection-error

Miscellaneous

Updates for the Hierarchy tool window

There is a new option to analyze the callees’ method hierarchy in the Hierarchy tool window. Previously, it was only possible to explore the callers of a selected method. Now, we’ve added two dedicated buttons to easily switch between the callers and callees of the selected method. Also, now you can sort the elements within a tree alphabetically, by clicking a special button in the menu. To see the Hierarchy tool window in the Tool Windows list, you’ll need to build a hierarchy first by going to Navigate | Call Hierarchy or Navigate | Type Hierarchy.

hierarchy-tool-window

Contrast scrollbars

Now you can make the scrollbars more visible. To do this, select the Use contrast scrollbars checkbox in Preferences/Settings | Appearance & Behavior | Appearance.

contrast-scrollbars-1

Set a custom shortcut for returning the focus to the editor

You can now set a custom shortcut for the action that takes the focus back to the editor, instead of using ESC. Find the Focus Editor action in Preferences/Settings | Keymap, right-click it, and select Add Keyboard Shortcut from the drop-down.

Whew, that’s about it. Try this Beta and share your impressions with us!

focus-editor

image description