Release notes for GoLand 2020.1
Code completion: suggestions of a pointer to a struct initializer
When you press Ctrl+Shift+Space to invoke the SmartType completion, GoLand suggests you a pointer to struct initializer in auto-completion.
Read more about code completion in Code completion.
Code completion: suggestions of compatible types in assertions and type switch cases
When you invoke the SmartType completion by pressing Ctrl+Shift+Space, you see compatible types in assertions and type switch cases at the beginning of the suggestion list.
Read more about code completion in Code completion.
Code completion: templates to generate interface and struct constructions
When you type the type
keyword, GoLand suggests you to auto-complete with type
, type ... interface
, type ... struct
.
Read more about code completion in Code completion.
Code completion: templates for handling errors
When you type if
inside a function, you can choose if err != nil { ... }
to automatically complete your code.
Read more about code completion in Code completion.
Code completion: improved behavior of the Fill Fields action
The Fill Fields action now adds spaces after colons when formatting rules require it. Also, the comma is added at the end of the statement in composite literals.
Read more about code completion in Code completion.
Code completion: suggestions for possible pointers
You can invoke SmartType by pressing Ctrl+Shift+Space to see a list of suggestions for possible pointers.
Code completion: suggestions of local variables and zero values in return statements inside functions
If the caret stays after the return
keyword inside a function, code completion suggests local variables and zero values even if they result in an error.
Code completion: suggestions of names for the current package declarations in comments
You can invoke code completion by pressing Ctrl+Space to see names for the current package declarations. Also, code completion includes parameter names for functions and methods.
Code completion: improved behavior of a cursor when defining maps
When you define a map, code completion places the cursor after the closing bracket after you complete a key type.
Read more about code completion in Code completion.
Code completion: suggestions of the assigned variable type in type assertions
The SmartType action (Ctrl+Shift+Space) in type assertions suggests the type of the assigned variable.
Code editing: improved usability in multi-value return types in a signature
GoLand adds parentheses around multiple return types automatically. Parentheses are added automatically. GoLand adds parentheses as you enumerate return values in a function signature.
Code inspections: a warning about incorrect uses of uintptr to unsafe.Pointer
The code inspection Invalid conversions of uintptr to unsafe.Pointer warns you about incorrect uses of uintptr
to unsafe.Pointer
to convert integers to pointers.
Code inspections: a warning that the argument, which is passed to store the result, is not a pointer or an interface
The code inspection Unmarshal is called with incorrect argument analyzes calls to json.Unmarshal
and similar functions of encoding/json
, encoding/xml
and encoding/gob
packages.
It reports a problem if the argument that is passed to store the result is not a pointer or an interface. Such calls are guaranteed to fail and return an error.
Code inspections: a warning about locks that are erroneously passed by value
The Checks for locks erroneously passed by value inspection detects situations when you copy a value that contains a lock. It might be a type that implements sync.Locker
like sync.Mutex
or sync.WaitGroup
.
Code inspections: a warning that pointer method cannot be called
In Go, you can call methods with a pointer receiver even on expressions with a non-pointer type. The Go compiler will implicitly take the address of the expression to make the call valid, if possible. Otherwise, you will get a compilation error.
GoLand detects these cases and suggests a quick-fix (Alt+Enter).
Color themes: the Default color scheme
You can use the Default color scheme again.
To customize color schemes, see Customize a color scheme.
Editor: the LightEdit Mode
With the new LightEdit mode, you can open a file in the text editor window without creating or loading a project.
If GoLand is launched, the file is opened in it. If GoLand is not running, the file is opened in the LightEdit mode.
Useful links
Command-line interface: see for more instructions on how to open a file, compare or merge files, and run code inspections.
External Documentation: a source of documentation is changed
The External Documentation action (Shift+F1) navigates you to https://pkg.go.dev instead of https://godoc.org.
Find usages: search for usages of interface methods is performed by default
The Find Usages (Alt+F7) action looks for usages of interface methods by default. To find usages of the current method, press Ctrl+Alt+Shift+F7.
Fonts: the JetBrains Mono font
The default font for GoLand is JetBrains Mono.
To configure colors and fonts, see Configuring colors and fonts.
Go Debugger: support of profiler labels
Since Go 1.9, you can record additional information to provide more context about the execution path. You can record any set of labels as a part of the profiling data and use these labels later to examine the profiler output.
For example, you have a queue handler that processes events created somewhere. The handler can set labels to identify where these events were created.
During debugging and core dump analysis, the context information might be helpful. For example, you can use this information to find a particular goroutine more easily.
Useful links
Code example at GitHub: try profiler labels yourself in GoLand.
Profiler labels in Go at rakyll.org: read more about profiler labels.
Go Modules: new actions to fetch missed dependencies and remove unused dependencies
You can fetch missed dependencies and remove unused dependencies in the go.mod file.
For more details, see Fetch dependencies.
Go Modules: templates for GOPROXY, GOPRIVATE, GOSUMDB, GONOPROXY, and GONOSUMDB
Without leaving GoLand, you can set the following environment variables: GOPROXY, GOPRIVATE, GOSUMDB, GONOPROXY, and GONOSUMDB.
Useful links
Environment variables: read more about introduction of environment variables in GoLand.
Go Modules: notifications about replacements of local paths in the go.mod file
GoLand displays a notification before you commit your changes if you replaced local paths in the go.mod file. This might help you to avoid situations when these replacements are committed by mistake.
To enable the feature, you must select the Perform code analysis checkbox in the Commit dialog settings.
Go Modules: code completion in go.mod files
GoLand 2020.1 supports code completion in go.mod
files for:
go
,module
,require
,replace
, andexclude
keywordsnames of dependencies
replacements with local paths, with the ability to rename them.
Go Modules: an automatic change of paths in go.mod files
When you move directories in the Project tool window ( ), GoLand changes the path in go.mod
file accordingly.
Go Modules: the Find Usages action is available in the context menu in the Project tool window
In the Project tool window ( ), right-click a directory to explore where this directory is used.
Go support: automatic vendoring mode
In Go 1.14 RC, vendoring mode is enabled automatically if the module root contains the vendor directory. Now automatic vendoring mode is a built-in Go feature. Starting from Go 1.14 RC, GoLand also enables automatic vendoring mode by default. You cannot change this setting.
For earlier Go versions, GoLand still has the Enable vendoring support automatically checkbox. If you add the vendor directory to the module, the IDE uses it. If you remove it, GoLand uses the global Go Modules cache.
Useful links
Go modules: see how to create a project with Go modules integration.
Vendoring: learn more about vendoring mode.
Go support: support of embedding overlapping interfaces in Go 1.14
When you describe different aspects of a type using overlapping interfaces, GoLand does not report duplicated methods as errors.
Before Go 1.14, you could not add the String()
method to the Employee
interface because the String()
method is already defined in the Person
interface. In the following example, you can see how Go 1.13.4 treats overlapping interfaces.
JetBrains Runtime: end of JBR8 support
GoLand uses JetBrains Runtime 11 (JBR11), and no longer distributes builds with JetBrains Runtime 8 (JBR8).
Live Templates: new templates to add groups of constants, variables, types, and imports
New live templates are added: consts, vars
, types
, and imports
. For these templates, GoLand adds braces around the expression by default.
Read more about live templates in Live templates.
Live Templates: the fori template for 'for' loops
The fori
template expands to for i := 0; i < ...; i++ { ... }
.
Read more about live templates in Live templates.
Performance: improved performance for Navigate to implementations and Navigate to Declaration or Usages
Navigate to implementations Ctrl+Alt+B and Navigate to Declaration or Usages Ctrl+B actions now work faster since they look for implementations in the project scope first. Search results display project elements before non-project elements instead of sorting them all alphabetically.
Postfix completion: the .else template to check if the expression is false
The .else
postfix template adds the if
statement that checks if the expression is false.
Read more about postfix completion in Postfix code completion.
Quick-fixes: updates for the Create variable quick-fix
The Create variable quick-fix shows a hint with the expected type. Also, the quick-fix automatically provides the Initialize with zero value action. This action creates a full variable declaration with the expected type, instead of a short declaration.
Quick-fixes: change Println to Printf
To change a non-formatting call to a formatting call, press Alt+Enter and select Change 'fmt.Println' to formatting function.
Refactorings: improved behavior of the Extract Method refactoring
Now when you extract a method or a function using the Extract Method refactoring (Ctrl+Alt+M), it keeps the original order of the parent function or method parameters.
Refactorings: the Implement Methods action allows you to specify parameters omitted in the interface definition
With the Implement Methods action, you can specify parameter names even if they are omitted in the interface definition.
For more information about the Missing Methods action, see Implement missing methods.
Refactorings: the in-place rename action
Prior to GoLand 2020.1, to rename an element, you invoke the Rename refactoring by pressing Shift+F6, type a new name for the element and apply it through code.
Starting from GoLand 2020.1, you can change the element name, invoke intention actions by pressing Alt+Enter and apply your change through code.
Run/Debug Configurations: macros as parameters
You can use macros as parameters in Go tool arguments and Program arguments fields of the run/debug configuration dialog.
In the Macros dialog, you can choose macros such as:
$GOROOT$: to retrieve the path to the project SDK.
$GOPATH$: to retrieve the Go executable path.
$ClipboardContent$: to get the content of the clipboard.
$Prompt$: for a string input to be used as parameters in your configuration.
Also, now you can store the configuration file in the project. Select the Store as project file option at the top of the run/debug configurations dialog. In previous versions, it was possible to share this file in the .idea
folder to share it through VCS with other team members.
Useful links
Environment variables: read more about introduction of environment variables in GoLand.
Spell checker: the Grazie plugin is bundled
Grazie provides spelling and grammar checks for texts that you write in the IDE. It supports English, German, Russian, Chinese, and other languages. In GoLand, Grazie is bundled.
You can manage all installed plugins in your IDE. For more information about plugin management, see Plugins.
User interface: a 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, which leaves room for the entire editor to show the diff.
User interface: introduction of Zen Mode
Zen Mode combines the Distraction Free Mode and the Full Screen Mode. To enable Zen mode, navigate to .