GoLand 2021.3 has native support for Go projects in WSL, the Inline Function refactoring, and support for remote development in Beta mode.
Starting from this version, gofmt
on save is enabled by default.
GoLand 2021.3 has some improvements for the debugger,
such as Delve for ARM64, the
Show Types option, and more.
There are two new postfixes for converting strings to numbers,
a new template for table tests with testify
assertions and better completion for values in struct tags.
As usual, the new GoLand version brings web development enhancements and a variety of new features for working with databases.
If you prefer an interactive approach to learning, complete the What's New in GoLand 2021.3 tutorial from the Welcome screen.
We’ve added the ability to open a project in WSL and specify an SDK located there.
If you create a new project (or open an existing one) in WSL,
GoLand will tell you that for this project you have to use a Go SDK in WSL.
You can download a Go SDK or choose an existing one in the \\wsl$
subdirectory.
gofmt
on save
The Reformat code option, which lets you run gofmt
and GoLand’s own formatter on save,
is now enabled by default.
This change might take some users by surprise, so we’ve added a notification that will be displayed once in every project. You can turn it off by clicking Don’t show again.
You can click Edit actions on save, and the IDE will open Settings | Tools | Actions on save where you can manage the settings.
The Inline refactoring for functions and methods is now available. To try it out, place the caret on a function, method, or invocation and then press Ctrl + Alt + N.
When you invoke the Inline refactoring, a popup window opens with several options. From this popup, you can also open the Refactoring Preview, which helps you find all of the invocations of a method or function.
We’ve improved the way different types of compound words – camelCase, snake_case, etc. – are handled when you add tags in struct fields.
When you fill out a tag, GoLand suggests a list of several options. After you’ve chosen one, the IDE remembers your choice and it will suggest the same style first in the list for other fields in this struct.
We have a couple of new postfixes for converting strings to numbers. Just type a number inside double quotes, then type a dot,
and GoLand will suggest two options for parsing the number: parseInt
and parseFloat
.
The Show Usages feature has been improved – you can now turn on the source code preview for a found usage by clicking the square icon.
You can now give meaningful names to the folders on the remote machine where the sources and executables for your project are stored. To configure the folders, go to Run | Manage targets | Additional Settings.
It is now possible to set a project-wide default run target. Go to Run | Manage targets. A window will open containing the Project default target option. If you choose a particular target for the project, all new configurations will be created with this target.
We’ve added the new HTTP/SOCKS Proxy section to SSH Configurations for you to specify a proxy server. You can find this section in Settings | Tools | SSH Configurations. Alternatively, from the opened project go to Run | Manage Targets | ...
nil
interfacesInterfaces in Go have two components, a type and a value of that type.
For an interface to be nil
, both of these components must be nil
.
If you have an interface with a value containing a nil
pointer to an
int
,
that interface will not be equal to nil
,
because the inner type is not nil
(it’s *int
).
This can be confusing.
To detect such cases, we changed how interfaces are represented
in the Variables tab of the Debug tool window.
For instance, if you have an interface with inner type *int
,
and value nil
, it will be shown like this: {interface{} | *int} *int(nil)
.
GoLand no longer displays the full package name in the debugger’s Variables tab. You will now see only the last part of the full name.
If object types take up too much space in the Variables tab, you can right-click in the tab area and deactivate the Show Types option in the menu that appears. You can turn it back on by selecting it again in the same menu.
Starting from this version, GoLand bundles Delve built for the ARM64 architecture and debugging on Linux ARM now works out of the box.
We’ve also improved error messaging when GoLand doesn’t bundle Delve for specific architectures. The IDE now explicitly tells you what’s wrong.
testify
assertionsWe’ve added a new template for table tests with testify
assertions.
If you have already used assert
in your package,
GoLand will generate some code with assertions when you press
Alt + Ins and choose the necessary option.
GoLand now has a quick-fix for an inspection that warns you about incorrect formatting of error strings: “Error strings should not be capitalized or end with punctuation”. Press Alt + Enter, and GoLand will suggest fixing the string format.
If you have written an exported function that returns an unexported type, GoLand will suggest a quick-fix to export that type.
context.TODO()
inspection
We’ve added an inspection that highlights the usages of context.TODO()
.
You can enable it in Settings
| Editor | Inspections.
The inspection will serve as a reminder to change context.TODO()
if it was unclear which Context
should have been used at the time of writing.
//TODO implement me
comment
We’ve added the //TODO implement me
comment for the templates generated
when you use the
Implement Methods action.
These special comments are highlighted in the editor, indexed,
and listed in the TODO tool window, allowing them to serve as reminders about unimplemented methods.
GoLand now supports a Beta version of remote development workflows.
You can set up remote development workflows right from GoLand’s Welcome screen. Alternatively, you can use JetBrains Gateway, our new application that serves as an entry point to all your remote backends.
Find instructions on how to get started with remote development on this page.
GoLand’s HTTP client now supports gRPC requests and provides completion for them.
Start your requests with the GRPC
keyword,
and the HTTP client will treat them as gRPC requests.
You can automatically generate a gRPC request in the HTTP client
by clicking on the gutter icons in your .proto
files.
Currently, the HTTP client can execute unary and server-streaming RPCs. Like in ordinary HTTP requests, the request body and responses are plain JSON files.
There are several other HTTP client improvements which you can read about here.
The Checkout and Rebase onto Current action allows you to check out the selected branch and rebase it on top of a branch that is currently checked out. Now it’s available for remote branches.
Sometimes, you may have several commits that are ready to ship while others are still works in progress. In such cases, you may want to push only the ones you are confident about.
You can now push commits up to the one you have selected in the Log tab of the Git tool window. To do so, pick the commit you want to stop at, right-click on it to call the context menu, and select the Push All up to Here action.
We’ve made the VCS settings more discoverable and structured. The Version Control node in Settings now lists all the available settings.
Evaluate expression functionality is now available in the Variables tab in the Debug tool window.
You can now split the Run tool window by dragging and dropping the tabs to the highlighted area. To unsplit the window, right-click the top pane and select Unsplit from the context menu.
We have a new Bookmarks tool window. From now on, all the files and folders that you mark as important with the F11 shortcut will be located in this window.
You can visualize the difference between the two snapshots on a flame graph. Press Shift twice and type "Open Profiler Snapshots" in the search bar. Open a snapshot from the list, repeat the same actions, and open another.
Then click the Compare With Baseline button in a tab of one of the snapshots. From the menu, select the snapshot that you want to compare against. A separate Diff tab will open with the results of the comparison.
GoLand’s terminal supports the new ConPTY API on Windows. We addressed several problems users were having with the old implementation, which was based on winpty, and enabled PTY on Windows by default.
With ConPTY, 24-bit colors are supported in the built-in terminal.
Previously, when you were typing characters in GoLand’s terminal while working on a remote machine, the IDE couldn’t display the characters as fast as it would on a local machine because of latency.
This is no longer an issue because we’ve introduced typeahead support. Our built-in terminal predicts text modifications and instantly displays them in light grey.
import
statementsYou can download remote ES6 modules using a quick-fix on the import path in ES6 files. The module will be downloaded with all its dependencies. To try it out, place the caret on the import path, then press Alt + Enter and select Download module.
We’ve improved the way code completion works in HTML. Whenever you type a tag name or an abbreviation in the editor or invoke code completion, GoLand will show you relevant suggestions right away.
Previously, it would only show them if you typed the opening angle bracket (<
) first.
Code completion for character entity references has been improved as well.
You can update your npm packages to the latest version right from the editor.
Open your package.json
file, place the caret on the package version you want to update, then press
Alt + Enter and select
Update … to the latest version.
GoLand has been updated with an intention action for JavaScript projects that lets you quickly put comma-separated elements on separate lines, and, if needed, back on one line.
We’ve added the ability to display the Aggregate view for a range of cells. Select the cell range you want to see the view for, then right-click and select Show Aggregate View. One aggregate value is displayed in the status bar, and you can choose which value you’d like it to be.
If you split the editor and open the same table, the data editors will be completely independent. You can set different filtering and ordering options for them.
We have a new inspection for boolean expressions in
WHERE
and HAVING
clauses.
If the expression doesn’t seem to be explicitly boolean, we highlight it in yellow and warn you before you run such a query.
It works for ClickHouse, Couchbase, Db2, H2, Apache Hive/Spark, MySQL/MariaDB, Redshift, SQLite, and Vertica. In all other databases, this will be highlighted as an error.
In the data editor, you can select several values and navigate to the corresponding data.
GoLand detects column types in CSV files, and now you can sort data by a numeric value. Before, data in columns was treated as text and sorting did not work as expected.
filter {}
and sort {}
Code completion now works when filtering data in MongoDB collections.
You can set fonts for the data editor separately from the rest of the IDE. To choose the font, go to Settings | Tools | Database | Data views | Use custom font.
We’ve addressed some accessibility issues to make working with the screen reader more comfortable. We’ve disabled the tool window widget pop-up and the quick documentation pop-up that used to appear on a mouseover.
Accessibility support on macOS has also been improved. We’ve resolved several issues with voiceover focus and made it possible to create projects using a screen reader. To minimize distractions while you're coding, we've reduced the number of help tooltips that play sounds.