GoLand 2020.1

Improves Go Module support and code editing.
April 14, 2020
New Version

Features

Go Module Improvements

  • Go 1.13’s environment variables GOPROXY, GOPRIVATE, GOSUMDB, GONOPROXY, and GONOSUMB are now supported. 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.
  • Code completion for go, module, require, replace, exclude keywords, dependencies’ names, and replacements with local paths is available for go.mod file.
  • 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.
  • Now you can also call up Find Usages via the Project View to explore where the path to a particular directory is used in the go.mod file.
  • In GoLand 2020.1 you can fetch missing dependencies and remove unused via Alt-Enter.
  • 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

  • GoLand 2020.1 will suggest if err != nil { ... } to complete an error-handling pattern. Just type if inside the expression.
  • 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

  • Smart Code Completion suggests a pointer to struct initializer.
  • It also suggests compatible types in assertions and type switch cases first.
  • In type assertion, it offers the type of the assigned variable.
  • Finally, it provides a list of suggestions for possible pointers in the expression.

Basic Code Completion

  • 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

  • GoLand 2020.1 adds parentheses around return types after the comma when writing a signature of a multi-value return function.
  • When you paste some text in a string literal, the IDE escapes double-quotes.

Go 1.14 support

  • Support for overlapping interfaces - Go 1.14 has added support for embedding overlapping interfaces, and so has this release. When you describe different aspects of a type using overlapping interfaces, GoLand will not report duplicated methods for them as errors.
  • Automatic vendoring mode - Vendoring mode is enabled automatically in Go 1.14 if the module root contains a vendor directory. GoLand 2020.1 implements 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 updates

  • Profiler labels support - To help you more easily distinguish between goroutines during debugging or core dump analysis, this release has added profiler labels to them.
  • Macros support - Now it’s possible to use macros as parameters to run or debug your application. In the Run/Debug Configurations 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

  • This 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

  • 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 and Navigate to Declaration or Usages now show results from the current project first. Also, the Find Usages action now always looks for usages of interface methods by default.

VCS Improvements

  • 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:
    • 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 - 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.

Databases updates

  • Run script files and code snippets using Run configurations. This allows you to run several files at once, reorder them, add new ones, and run other programs or configurations before launch.
  • Now you can see the results in the code editor. This option is disabled by default. To turn it on, go to Settings/Preferences | Database | General | Show output results in the editor.
  • Create a configuration of the SSH tunnel and use it in many data sources or even in projects.
  • Added the ability to export data to an Excel file.
  • Also, you can choose your preferred data format in the extractor drop-down.

Web Development

  • New smart intentions and inspections for JavaScript and TypeScript - Use new smart intentions and inspections (Alt+Enter) to save yourself some time when coding! For example, you can now quickly convert the existing code to optional chaining and/or nullish coalescing, the syntax introduced in the latest versions of JavaScript and TypeScript.
  • More helpful quick documentation - For JavaScript and TypeScript, the Documentation popup now shows more useful information, including details about the type and visibility of the symbol as well as where that symbol is defined.

More changes

  • 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
  • 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.
  • Brought back the Default color scheme, albeit with a new name, Classic Light.
Go Module improvements

GoLand

A cross-platform IDE built specially for Go developers.

GoLand is also available in:

Got a Question?

Live Chat with our JetBrains licensing specialists now.