JetBrains представила релиз GoLand 2020.2 - кросс-платформенной IDE для продуктивной разработки на Go
JetBrains представила релиз GoLand 2020.2 - кросс-платформенной IDE для продуктивной разработки на Go
GoLand 2020.2: Новые функции для модулей Go, лучшее представление о возможных проблемах и слабых местах в вашем коде, новые проверки кода, новые функции редактирования кода, такие как долгожданная функция Add Caret Per Selected Line, ссылки и поддержка навигации по комментариям для упрощения кода. read, а также возможность настройки переноса для аргументов вызова, параметров функции и составных литеральных элементов.
Кроме того, JetBrains добавили экспериментальную поддержку обобщений (a.k.a. type parameters), возможность обмениваться кодом на игровой площадке Go из редактора, обновления для контроля версий, включая поддержку WSL 2 для Git в Windows, и многое другое!
Go modules support
- Support for the GOMODCACHE environment variable, which is coming soon with Go 1.15.
- For replace, exclude, and require statements, the IDE provides a closing brace immediately when typing the opening brace.
- Support for commenting in go.mod files.
Get everything from comments
- GoLand 2020.2 shows references from doc comments to related package-level declarations and lets you navigate to them via the Navigate to Declaration or Usage action.
Code inspections
- The Inspections widget displays the number of warnings, errors, and typos in the current file.
- The Problems tool window shows a list of warnings and errors in the current file, gives you a description of the problems, and lets you fix them immediately via
Alt+Enterand navigate to them in the editor via right-click. - The Malformed struct tag code inspection checks that struct tags conform to Go conventions.
- A new code inspection handles possible problems with string(int) conversions and lets you fix them easily with quick-fixes.
- Other new code inspections check for commonly mistaken usages of tests and examples, and provide quick-fixes to remedy them.
Code editing
- We’ve added the option to configure wrapping for call arguments, function parameters, and composite literal elements in Preferences/Settings | Editor | Code Style | Go | Wrapping and Braces.
- The Put arguments on separate lines and Put arguments on one line intention actions can be used to split or join call arguments, function parameters, and composite literal elements.
- The new Add Caret Per Selected Line action creates carets on each selected line and deselects the lines so you can begin typing.
- Intentions Preview lets you preview the result of intention actions and quick-fixes before you actually apply them.
Take control of variadic arguments
- The Introduce Variable refactoring can pack some variadic arguments into a new slice variable, while Inline Variable, conversely, unpacks a slice into variadic arguments.
- The Unpack slice quick-fix handles issues with unpacked variadic arguments.
Save projects as templates
You can now save projects as custom templates – select Tools | Save Project as Template.
Go Playground
Now you can share code to the Go Playground directly from the editor.
Generics, a.k.a. type parameters
GoLand 2020.2 provides experimental support for generics that you can play with by turning on the Enable generics (experimental support for type parameters) setting in Settings/Preferences | Go.
Under the hood
- Faster resolve for projects with a vendor folder.
- GoLand runs go list commands sequentially and provides a progress bar.
VCS
- WSL 2 support for Git on Windows.
- Improved Git action dialogs.
- Full support for GitHub pull requests.
- Compare branches with all the required information in one view.
- Squash local commits from the log.
Database improvements
- Added support for the Google BigQuery dialect.
- New UI for boolean values.
- Separate editor for long cell values.
- DML preview in the data editor.
Web development
We’ve added new smart intentions (Alt+Enter) to help you perform some actions faster. For example, you can now quickly convert a for loop with a numeric index into a forEach array method.
