GoLand 2020.2

Ajoute de nouvelles fonctionnalités pour les modules Go.
Août 3, 2020
Nouvelle Version

Fonctionnalités

Go Modules improvements

  • Set new GOMODCACHE environment variable in the Environment Variables dialog - Starting with Go 1.15, you can change the default location of the modules cache from $GOPATH/pkg/mod to another folder using the new GOMODCACHE environment variable. To do that, just set GOMODCACHE in Preferences/Settings | Go Modules | Environment. The IDE will recognize the custom location and use it for all subsequent actions with dependencies.
  • Commenting module dependency in the go.mod file - The Comment With Line Comment action is now available for the go.mod file.
  • GoLand completes a closing brace in go.mod file for replace statement - GoLand now immediately adds a closing brace when you type the opening brace for replace, exclude, and require statements.

Get everything from comments

  • Navigation from comment to source code - The IDE displays references from comments to related package-level declarations and lets you navigate to them via the Navigate to Declaration or Usages action.

Code inspections

  • The new Inspections Widget shows the number of warnings, errors, and typos in the current file in the upper right-hand corner of the code editor.
  • The Problems tool window displays a list of warnings and errors in the current file, gives you a description of those problems, and lets you fix them immediately using Alt+Enter.
  • A new code inspection handles possible problems with string(int) conversions which return the UTF-8 representation of the Unicode code point x instead of the expected decimal string representation of x.
  • GoLand will notify you about common erroneous usages of tests and examples, so you don’t need to call go vet explicitly for that anymore. The IDE also provides quick-fixes in simple cases; for example, it suggests renaming Testme to TestMe.
  • The Malformed struct tag code inspection will check that struct tags conform to Go conventions and notify you about potential problems.
  • The Impossible interface type assertion code inspection checks for type assertions v.(T) and corresponding type-switch cases in which the static type V of v is an interface that cannot possibly implement the target interface T.

Code editing

  • To preview the result of an intention action or quick-fix before you apply it to your code, invoke the Show Context Actions with the Alt+Enter shortcut.
  • The new Add Caret Per Selected Line action creates carets at the end of each selected line and deselects the lines.
  • Configure wrapping for call arguments, function parameters, and composite literal elements in Preferences/Settings | Editor | Code Style | Go | Wrapping and Braces. Alternatively, you can use the Put arguments on separate lines and Put arguments on one line intention actions using Alt+Enter to split and join elements manually.

Take control of variadic arguments

  • Inline Variable refactoring unpacks a slice into 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 in action - In addition, you can now handle issues with unpacked variadic arguments via the Unpack slice quick-fix.

Save projects as templates

  • Save Project as Template tool window - You can now reuse projects or files by saving them as custom project templates: select Tools | Save Project as Template. The IDE will recreate the project tree with files, folders, and build configurations.

Go Playground

  • Share in Playground action in the dropdown menu - You can now share and execute code in the Go Playground by double-clicking inside 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 experimental support for generics a.k.a. type parameters setting in Settings/Preferences | Go. This initial support provides syntax highlighting and basic reference resolution, and works in go2 files only.

Under the hood

  • With vendoring mode enabled, you build your application with only the dependency packages that are stored in the vendor folder in your project.
  • GoLand runs go list commands sequentially and provides a progress bar with information about the actual numbers of go list commands in the queue.

Version Control

  • WSL 2 support for Git on Microsoft Windows - GoLand 2020.2 will allow you to use Git from WSL 2, which is natively available in the May update of Windows 10, version 2004. If Git is not installed in Windows, GoLand will automatically look for Git in WSL and use it from there. It will also automatically switch to Git from WSL for projects opened from WSL (via \wsl$ path).
  • Improved Git action dialogs - Redesigned the Git dialogs for actions such as Merge, Pull, and Rebase to make them more consistent and informative. Also made it easier to understand which Git command will be executed, and added the –rebase option to the Pull dialog and the –no-verify option to the Merge dialog.
  • Full support for GitHub pull requests - GitHub Pull Requests is fully equipped! Browse, assign, manage, and even merge pull requests, view the timeline and inline comments, submit comments and reviews, and accept changes without leaving GoLand.
  • Improved presentation of Compare branches results - Now when you are comparing 2 branches in GoLand, you’ll be able to see the commits of the compared branches in one view. The IDE will now open the logs of both branches being compared in the editor instead of in the VCS tool window, where there is not enough space to display all the information.

Databases updates

  • Separate editor for cell values - Now if you have a huge value in your cell, it can be viewed or edited in a separate panel. You can also toggle soft wrap mode using the right-hand toolbar. Use all the power of our code editor for your data.
  • DML preview in the data editor - Starting with this version, you can review the query that represents your changes in the data editor. There is now a DML button that is active if there are pending changes. And you will see a dialog with the DML preview. This query is not the exact SQL that will be run to modify your data, because GoLand uses a JDBC driver to update tables, but most of the time it will be the same.
  • A new UI for boolean values - There’s now a more user-friendly way to view and edit boolean values. True values are now marked with a bullet point to distinguish them from all the others.
  • Google BigQuery dialect - Added a new SQL dialect: Google BigQuery. Full support for BigQuery is not here yet, but all things must begin somewhere. GoLand can correctly highlight and provide coding assistance for your queries if you use Google BigQuery.

JavaScript and TypeScript

  • New smart intentions - New smart intentions (Alt+Enter) will 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. Looking through documentation comments in JavaScript and TypeScript files has also become easier as you can now render them right in the editor, minimizing all distractions.
Change the default location of the modules cache

GoLand

Un environnement de développement multi-plateformes conçu spécialement pour les développeurs Go.

GoLand est également disponible en :

Vous avez une question ?

Discutez en direct avec l'un de nos spécialiste des licences JetBrains .