Go logo

GoLand

A cross-platform Go IDE with extended support for JavaScript, TypeScript, and databases

Early Access Program Features

GoLand 2019.1 EAP 4 is out with Nilness Analyzer, built-in Sublime Text keymap, ‘Uncheck all’ checkbox for partial Git commits, and more

GoLand 2019.1 EAP 4 is here!

Get this new EAP build via Toolbox App, from the website, as a snap package (for Linux), or right in GoLand – just select Automatically check updates for Early Access Program in Preferences / Settings | Appearance & Behavior | System Settings | Updates.

Download GoLand 2019.1 EAP 4

Here’s a list of notable issues this update addresses:

Short reminder: during the entire Early Access Program, we provide fresh builds based on the latest development code, almost every day!

Long story short:

  • These fresh builds are called nightly builds.
  • They are available only via Toolbox App.
  • Their quality is usually below our normal standards, and they don’t have release notes.
  • Like EAP builds, they also expire 30 days after their release.

Let’s take a look at what this new build has inside!

Nillness Analyzer

Go gives us many ways to make the zero value useful, from using it as a pointer receiver to default values in functions or interface values. But the more opportunities we have, the easier it is to fall into a trap, whether you are a pro or beginner.

The Nilness Analyzer instantly detects variables that might have nil or not nil values and alerts you to potential errors and problems.

Let’s have a look at the Nilness Analyzer in action. For example, it warns you about:

Redundant comparisons such as v == nil if v is known to be always nil or not nil.

nilness-analyzer

Using method calls with a nil receiver. In some cases, it means that we try to access a variable pointing to nothing and could lead to ‘nil pointer dereference’.

nilness-analyzer-2

Unintentionally raising panics when indexing a nil slice:

nilness-analyzer-3

Sometimes you know better that a particular piece of code is just fine and no warnings are necessary, so you can simply disable a certain warning or change its severity level via Preferences/Settings | Editor | Inspections.

Code inspections

Multiple defaults in switch warns you about redundant default cases in a switch statement and lets you quickly navigate to the duplicated default.

multiple-defaults-switch

The Duplicate names code inspection now notifies you if dot import introduces a duplicate.

Also, GoLand now validates arguments of new call expressions. For example, if you want to add more than one argument to new func, the IDE will warn you immediately.

Sublime Text keymap

At JetBrains, we make tools for developers, by developers. We know that switching between the mouse or trackpad and the keyboard takes a lot of time, though we also know that remembering new shortcuts is not an effortless process, especially if you’re used to a favorite set of key combinations.

This is why GoLand’s collection of pre-configured keymaps now offers Sublime Text by default. Choose it via the drop-down list in Preferences | Settings | Keymap.

sublime-text

Run to Cursor as mouse gesture

The Run to Cursor action is now available by clicking on a line number while debugging. When you hover over a line, the IDE will highlight this line. If you click on a line number, the IDE will invoke Run to Cursor by mouse.

run-to-cursor-mouse-gesture

Uncheck for partial commit

Partial Git commits (git add -p) let you easily commit only selected changes from a file, by using the checkboxes in the Diff pane of the Commit Changes dialog. The new Uncheck all checkbox helps you commit a particular change with more ease if you have many of them in a file. It unchecks all the code chunks at once and lets you choose the ones you want to commit.

uncheck-for-partial-commit

Export your Code Style settings to JSON

GoLand already had an option to export your Code Style settings to XML. Now it is possible to export them to JSON as well. This is available under Preferences /Settings | Editor | Code Style.

Note there is one difference from exporting to XML: a JSON file contains all the code style settings for the available languages by groups, even if they match the default ones.

code-style-settings-json

Adding file content to the Blank Diff window by drag-n-drop

Copy & paste text to the Blank Diff window by dragging a file to it. Alternatively, you can do the same through file navigation.

DiffDragDrop

Notable bug-fixes

  • Fixed loading coverage from a file for Go modules.
  • Fixed problems with breakpoint initialization.
image description