The stable version of GoLand 2020.1 has been released . In addition to improving support for Go Modules, GoLand 2020.1 also brings many developer-friendly features in code editing, as well as adding new types for auto-complete code features. There are also improvements in code inspection and quick fixes.
Download address https://www.jetbrains.com/go/download
The official said that this is a faster and smarter version, continue to see what are the highlights.
Improve support for Go Modules
- It is more convenient to configure environment variables : You can now use the Go Modules project template to configure the default values of environment variables. Just click the "Browse" icon in the "Environment" form to open a new "Environment Variables" dialog box.
- Improved support for go.mod files : support for keywords (
go
,module
,require
,replace
andexclude
), dependency names, and replace undergo completion by the local path
- Refactored Rename and Move functions : when renaming or moving the directory referenced by the 'replace' statement, GoLand will change the path in the go.mod file accordingly
- Call Find Usages. Through Project View to browse the path of a specific directory in the go.mod file
Go 1.14 support
- Support for overlapping interfaces : Go 1.14 added support for embedded overlapping interfaces, and GoLand 2020.1 also supports this feature. When using overlapping interfaces to describe different aspects of a type, GoLand does not report duplicate methods for these aspects as errors.
- Automatic vendoring mode : If the module root directory contains the vendor directory, the vendoring mode will be automatically enabled in Go 1.14. For GoLand 2020.1, similar behavior will be implemented for Go 1.13 and earlier. The IDE will automatically resolve the import to the vendor / folder (if it exists in the module).
Code editing
- When writing the signature of a multi-value return function, GoLand 2020.1 will automatically add parentheses after the comma of the return type
- When pasting some text in a string literal, the IDE will use double quotes for escaping
Smart code completion (⌥⇧Space or Ctrl + Shift + Space)
- With this feature enabled, the IDE will suggest a pointer to the initializer of the structure
- It is recommended to use compatible types first in assertions and type switch use cases
- In the type assertion, provide the type of the assigned variable
- Provide a suggested list of pointers that may exist in the expression
Basic code completion (⌃Space or Ctrl + Space)
- Added basic code completion features to comments, making it easier to write documentation. This feature provides suggested naming for the current package declaration and suggested parameter names for functions and methods
- In addition, it will provide suggestions on literal and conversion
Debugger
- Add a profiler label (profiler label) for easier differentiation of goroutine during debugging or core dump analysis
- Added support for macros. In 2020.1, macros can be used as parameters for running or debugging applications. In the Run / Debug Configurations dialog box, click the + or Program arguments option in the Go Tool to open the new Macros dialog box, which lists the available macros to be used. In addition, configuration files can now be stored in the project. At the top of the Run / Debug Configurations dialog, select Store as the project file option
Quick fix
- Press Alt + Enter shortcut key to immediately convert unformatted calls to formatted calls
- Create variable quick repair function will display the expected type prompt to facilitate the user to enter the correct value better
See https://www.jetbrains.com/go/whatsnew/ for details