GoLand 2021.3 Beta 2: Improved Error Messages for Debugging Tests and the Ability to Compare Profiler Snapshots
GoLand 2021.3 Beta 2 is out.
You can get the build via the Toolbox App, download it from our website, use a snap package (for Ubuntu), or from inside the GoLand IDE select Check IDE updates for Early Access Program in Preferences / Settings | Appearance & Behavior | System Settings | Updates.
Improved error messages for debugging tests
When you select a directory in a project tree and run Debug | go test ‘directoryName’, you will get a vague error.
It happens because, in this case, GoLand creates a configuration with Test Kind: Directory, and you can’t debug tests in directory-kind configurations.
The message, which was shown for this kind of error, was not very understandable.
We have improved it, and now the error says that you can’t debug tests in directory-kind run configurations, but you can debug tests for each package.
There is also a link to the Run/Debug Configurations settings where you can change Test kind from Directory to Package.
Visualize the difference between profiler snapshots
The profiler is GoLand’s main tool for diagnosing performance issues and exploring program operation at runtime. Naturally, it would be nice to be able to compare two profiler snapshots.
In this build, we’ve introduced the ability to visualize the difference between two snapshots on the flame graph.
From the opened project go to Run | Open Profiler Snapshots. Or press ⇧ (Shift) twice and type “Open Profiler Snapshots” in the search bar.
You will see a list of snapshots. Open one of them, then repeat the same actions to open another.
Then click the Compare With Baseline button staying 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, combining two flame graphs and showing the differences as red and green.
If you see that 6% percent of the frame is green, it means that the corresponding method became 6% faster during the second profiler run. The red color means that the corresponding method became slower.
Other improvements and bug-fixes
- GO-11860 – We’ve disabled Optimize Imports while running the Sync dependencies of ‘projectName’ quick fix, and GoLand no longer removes import declarations when you apply this quick fix.
- GO-11868 – math.Floor() and other functions from the math package work as expected in the Evaluate Expression dialog. GoLand 2021.3 will have a fix for this bug. For earlier versions, follow these instructions.
That’s it for today! If you want a full overview of the features that will make their way into v2021.3, read this post. You can report any bugs or suggest ideas here in the comments, on Twitter, in our tracker, or in the Gophers Slack #goland channel.