GoLand 2020.1 Reaches Beta!
Releasing this Beta means our Early Access Program is approaching the home stretch. We’ve stopped adding new features and are focusing on polishing everything.
The Beta is quite stable in comparison to our Early Access Program builds, but keep in mind there may still be some rough spots here and there.
Please note that this Beta build is the last build in the EAP train that does not require a subscription to use (if you are just looking to give GoLand a try). Betas are usually followed by a Release Candidate once we see that the build is good enough and that it’s ready to be installed on your machines.
For this upcoming release, we have focused on Go Modules support, and you might just be amazed at how many cool things we’ve added to help you have more fun working on this type of project!
Another area of focus has been code-editing features that require little to no interaction from the user. Many new types of code completion are waiting for you to try.
On top of that, there are new code inspections, quick-fixes, and other nice things, such as a new mode that lets you open a file in the text editor without creating or loading a project. Intelligent spelling and grammar checks are now bundled by default via the Grazie plugin. And all of our IDEs, including GoLand, now feature our own typeface, JetBrains Mono, as the default font. (In fact you’ve already seen some of it as we’ve been using this font in all our screenshots and GIFs for a while now.)
Now is a great time to provide feedback! We love hearing from you, and we’re always listening, so don’t think twice about sounding off.
Without further ado, let’s have a look at what’s lurking inside the upcoming release. Choose a topic you are interested in, or go through the whole blog post to learn about each new feature.
- Go Modules
- Code Completion features you don’t need to learn how to use
- Smart Code Completion (⌥⇧Space or Ctrl+Shift+Space)
- Basic Code Completion (⌃Space or Ctrl+Space)
- Code editing
- Go 1.14 support
- Debugger
- Postfix Completion
- Quick-fixes
- Code Inspections
- Live Templates
- Refactorings
- Navigation
- VCS
- More changes
Go Modules
When it comes to Go 1.13’s environment variables, you can configure their default values using the Go Modules projects template. Simply click the Browse icon in the Environment field to open the new Environment Variables dialog.
We’ve also taken GoLand’s support for go.mod
files to the next level. Have a look!
Code completion for keywords, dependencies’ names, and replacements with local paths is available.
Rename and Move refactorings are also in business. When you rename or move directories referenced by ‘replace’ statements, GoLand will change the path in the go.mod
file accordingly.
Call up Find Usages via the Project View to explore where the path to a particular directory is used in the go.mod
file.
GoLand 2020.1 will help you fetch missing dependencies and remove unused dependencies via Alt-Enter.
Last but not least, the new version will show a notification before you commit if there are replacements with local paths, so that you don’t commit them by accident.
Code Completion features you don’t need to learn how to use
We say NO to boilerplate code!
GoLand 2020.1 will suggest if err != nil { ... }
to complete an error-handling pattern. Just type “if” inside, and that’s all!
Define struct and interface types faster simply by typing the ‘type’ keyword or “struct” and “interface”.
The Fill Fields action adds spaces after colons when required by the formatting rules. It also adds a comma at the end of the statement in declarations of composite literals.
Now when you are working with maps, code completion moves the cursor to behind the closing bracket after you complete a key type.
For the return type of the function, completion provides suggestions for local variables and zero values that will be appropriate for the corresponding return value type.
Smart Code Completion (⌃⇧Space or Ctrl+Shift+Space)
In GoLand 2020.1, Smart Code Completion will suggest:
- A pointer to struct initializer.
- Compatible types in assertions and type switch cases first.
- The type of the assigned variable in type assertion.
- A list of possible pointers in the expression.
Basic Code Completion (⌃Space or Ctrl+Space)
Please welcome Basic Code Completion for comments, which makes writing documentation a lot easier! It suggests names for the current package declarations and parameter names for functions and methods.
Besides that, Basic Code Completion will suggest literals and conversions.
Code editing
There are even more features that work without you having to do anything. When you see them in action, just smile and continue coding!
GoLand 2020.1 will automatically add parentheses around return types after the comma when writing a signature of a multi-value return function.
Also, the upcoming version will automatically escape double-quotes when you paste some text in a string literal.
To learn more, read GoLand Editing Features You Didn’t Know About article.
Go 1.14 support
Go 1.14 has added support for embedding overlapping interfaces, and so have we! When you describe the different aspects of a type using overlapping interfaces, GoLand will not report duplicated methods for them as errors.
Vendoring mode is enabled automatically in Go 1.14 if the module root contains a vendor directory. For GoLand 2020.1, we’ve decided to implement similar behavior for Go versions 1.13 and earlier. The IDE will automatically resolve imports to the vendor/ folder if it is present in the module.
Debugger
To help you more easily distinguish between goroutines during debugging or core dump analysis, we’ve added profiler labels to them. If you’d like to learn more, read this article: How to Find Goroutines During Debugging.
Now it’s possible to use macros as parameters to run or debug your application. In the Run/Debug Configuration dialog, click + in the Go Tool or Program arguments fields to open the new Macros dialog with the list of available macros to use.
In addition, you can now store the configuration file in the project. Select the Store as project file option at the top of the Run/Debug Configurations dialog.
Postfix completion
The .else Postfix Completion template quickly adds an “if” statement to check if the expression is false.
Quick-fixes
Change a non-formatting call to a formatting one in no time, by pressing Alt+Enter.
The Create variable quick-fix now shows an expected type hint to make it easier to enter the right value.
Code inspections
A new code inspection warns you about invalid calls of pointer methods on non-pointer receivers and offers a quick-fix.
The code inspection Invalid conversions of uintptr to unsafe.Pointer warns you about incorrect uses of uintptr
and unsafe.Pointer
to convert integers to pointers.
The inspection Unmarshal is called with incorrect argument analyzes calls to json.Unmarshal
and similar functions of encoding/json
, encoding/xml
, and encoding/gob
packages.
The Locks mistakenly passed by value code inspection helps you avoid accidentally copying a value that contains a lock.
Live templates
We’ve added new templates to help you quickly create groups of declarations. These include consts, vars, types, and imports. When you use one of these templates, GoLand will add braces around the declaration names.
The fori template inserts the boilerplate code for the classic for-loop.
Refactorings
The Extract Method refactoring keeps the original order of the parent function and method parameters.
The Rename refactoring now detects the renaming of a declaration automatically. This means that when you rename a declaration manually, the IDE will show a gutter icon that will offer to rename all its usages.
Navigation
Navigate to implementations (⌥⌘B on macOS and Ctrl+Alt+B on Windows/Linux) and Navigate to Declaration or Usages (⌘B on macOS and Ctrl+B on Windows/Linux) now show results from the current project first.
Also, the Find Usages (Alt+F7 on Windows/Linux or ⌥F7 on macOS) action now always looks for usages of interface methods by default. To find usages of the current method as before, use Alt+Shift+Ctrl+F7 on Windows/Linux or ⌥⇧⌘F7 on macOS.
VCS
New Commit tool window
The new commit tool window now incorporates the Local Changes and Shelf tabs. This tool window covers all commit-related tasks, like checking diffs, selecting files and chunks to commit, and entering a commit message. Commit is a vertical tool window located on the left side of the screen, which leaves room for the entire editor to show the diff.
Improved Branches popup
The Branches popup has been reworked in several ways:
- We’ve added an explicit search field that enables you to look for existing remote and local branches.
- Now you can use the Refresh button to update the existing remote branches.
- Incoming (blue) and outgoing (green) commit indicators have been added to the status bar.
Interactively Rebase from Here dialog
We have substantially reworked Interactively Rebase from Here. This is a dialog that allows you to edit, combine, and remove your previous commits in order to make your commit history more linear and comprehensible.
To invoke this dialog, go to the Log tab of the Git tool window, select the oldest commit in the series of commits you want to edit, right-click it, and choose Interactively Rebase from Here.
Other
- JetBrains Mono, a new font from JetBrains, is available by default.
- Grazie, a plugin that provides intelligent spelling and grammar checks for text that you write in the IDE, is bundled by default.
- The new LightEdit Mode allows you to open a file in the text editor without creating or loading a project. To try this new functionality out, you will first need to create a command-line launcher from Tools | Create Command-line Launcher, as described here (if you’re using the Toolbox App, the steps will be slightly different). For more detailed instructions on how to open a file, compare/merge files, and even run code inspections, see this web help section.
- We’ve added the new Zen Mode, which gets rid of possible distractions and helps you focus completely on your code. In its essence, this mode combines the Distraction Free Mode and the Full Screen Mode. To enable it, go to View | Appearance | Enter Zen Mod, or choose it from the Quick Switch Scheme popup (Ctrl+` | View mode | Enter Zen Mode).
- External Documentation now leads to https://pkg.go.dev instead of https://godoc.org.
- We’ve brought back the Default color scheme, albeit with a new name, Classic Light.
Whew, that’s about all for this Beta. Do try it and tell us what you think. Thanks!
Your GoLand team