GoLand 2021.2 Early Access Program Is Open!
The GoLand 2021.2 Early Access Program is starting. You can find a brief description of what’s to come in the roadmap blog post for 2021.2.
You can get the first EAP build via the Toolbox App, download it from our website, use a snap package (for Ubuntu), or from inside GoLand, select Automatically check updates for Early Access Program in Preferences / Settings | Appearance & Behavior | System Settings | Updates.
What the Early Access Program is:
EAP builds let you try out the latest features and enhancements in GoLand while we continue to work on them. These builds are not fully tested and might be unstable, but this is where you can help us. By taking these builds and their new features for a test drive in your real-world projects and scenarios, you can help us polish them. This way, when the final version is released, it will work smoothly for you.
- The EAP lets you be the first to try out the newest features.
- EAP builds are free to use for 30 days from the build date. You can use this period as an extended trial of GoLand.
- We provide a series of EAP builds until a stable release is almost ready. For the upcoming version 2021.2, the EAP period will last until mid-July.
- In each release cycle, we reward the most active evaluators and people who helped us make GoLand better by sharing their product experience, feedback, and suggestions with a free 1-year GoLand subscription.
- Fresh builds come out almost every day. If you don’t want to wait for the official EAP build announcements, you can simply download our nightly builds, which are only available via the Toolbox App. Note that the nightly builds often do not meet the quality standards for official EAP builds, and they don’t come with release notes. Like EAP builds, they expire within 30 days of being released.
Let’s take a look at what we’ve packed into this EAP build.
Enable gofmt easily
When you work with Go, you can use “gofmt” to format your code. As you may know, GoLand has its own formatter. There are also ways to enable “gofmt” in the settings, but users regularly asked us to make this option more discoverable or enable it by default. The challenges we faced while trying to find the right solution are described in this blog post.
We’ve decided to start by enabling a “gofmt” pass after running GoLand’s formatter, but only as an option. This is the first step, and more changes are to come.
In this release, we introduced the “Run gofmt on code reformat” option. It’s enabled by default and can be controlled in Preferences/Settings | Editor | Code Style | Go. When this option is checked, you can invoke both formatters with a shortcut Ctrl + Alt + L (Cmd + Alt + L), and “gofmt” will be run after GoLand’s formatter. Thus, both the user settings and the default style are applied.
Remember that you have other ways to use “gofmt” in GoLand:
- Dedicated actions. Under the Tools | Go Tools menu, you’ll find two actions related to code formatting: Go Fmt File and Go Fmt Project.
- Before commit tools. There are several hooks that can be configured to run before commit. Go to Preferences/Settings | Version Control | Commit | Before commit and find Go fmt, which is enabled by default.
- File watcher. Under Preferences/Settings, you can find Tools | File Watchers. Add a new watcher by using the predefined ‘go fmt’ template. Whenever a Go file is changed, the command is executed on it.
Support for bug-resistant
Go allows you to use build constraints to write different code for different compilation contexts. A build constraint (or a build tag) usually lists the condition under which the file should be included in a package during the build process.
A year ago, the authors of Go suggested that build constraints syntax should be changed to avoid multiple bugs.
The old syntax looks like a line comment with
//+build at the beginning, which is followed by the OS name, the architecture, or some other conditions. To list multiple conditions, you can use a comma (logical And) and a whitespace (logical Or). For example:
//+build darwin,cgo linux
The new syntax looks like a line comment with
//go:build at the beginning. To list multiple conditions, you should use boolean expressions: the && operator (logical And) and the || operator (logical Or):
//go:build darwin && cgo || linux
There is a transition period that will last from Go version 1.16 through version 1.18. During this period and afterward, certain rules will be in place.
For example, according to the new syntax you can only place
//go:build constraints at the top of the file. If you place them anywhere else in the file, GoLand will suggest a quick-fix that will move the
//go:build lines to their proper location.
In the 1.16 version of Go, you can use the old syntax or both. We recommend getting used to the new one. You can write
//go:build lines, and if there are no
//+build lines, GoLand will suggest a quick-fix generating them.
Here you can read about the transition period in more detail.
If you need to configure the IDE to address particular needs, this feature is for you. We’ve added a new node — Advanced Settings — to Preferences/Settings. It contains additional configuration options. Most of them were transferred here from Registry, but some are new. For example, you can configure a left margin for Distraction-free mode.
There is also a new navigation option in Preferences/Settings. It is now possible to navigate back and forth between sections using the arrows in the top right corner of the window.
Automatic cache and logs cleanup
Starting from this EAP, the IDE will automatically clean up cache and log directories that were last updated more than 180 days ago. This process won’t affect the system settings and plugin directories. You can clean up the logs and cache manually using the Help | Delete Leftover IDE Directories… action.
Browser pages reload on save
Page reloading is turned on by default. To try this feature, open an HTML file, click on the icon of your favorite browser in the top right corner of the window, and make some changes.
You can turn off automatic page reloading in the Built-in Server section of Preferences/Settings | Build, Execution, Deployment | Debugger.
That’s it for today! Please tell us what you think about our new features. We appreciate your feedback, so please share it with us here in the comments, open an issue in our tracker, drop us a line in the Gophers Slack #goland channel, or ping us on Twitter.
Subscribe to Blog updates
Goland 2023.3 Beta Is Out!
Get the Beta build via the Toolbox App, from our website, by using a snap package (for Ubuntu), or right from inside GoLand by selecting Check IDE updates for: Early Access Program in Settings | Appearance & Behavior | System Settings | Updates. Download GoLand Beta …
The GoLand 2023.3 Early Access Program Has Started!
The Early Access Program for GoLand 2023.3 is now open!
What’s next: GoLand Roadmap 2023.3
We are going to address some of the older issues and add some fancy features in 2023.3. Check out what's coming in the next GoLand release!