GoLand 2022.2

Adds new features for generics and go.work along with support for fuzz tests.
August 01, 2022 - 10:57
New Version

Features

  • Generics
    • Intention action to convert empty interfaces to any - GoLand now has an inspection that reports the usage of an empty interface as a type or type constraint. There is also an intention action that replaces interface{} with any. From the intention action’s popup, you can replace all empty interfaces in a file.
    • Quick-fix to delete type parameters with empty parameter lists - Type parameters with empty parameter lists are now reported as errors. A quick-fix has been added to delete them.
    • Inspection for unused type parameters - Added a new inspection that reports unused type parameters. They are grayed out, and you will see a warning when you hover over them.
    • Inspection for union of interfaces with methods - The IDE now reports an error if you attempt to use interfaces with methods in unions.
    • Inspection for usage of a type parameter as a constraint - If you try to use a type parameter as a constraint, GoLand will display an error.
    • Completion for type parameters when typing a method’s receiver - GoLand now automatically inserts a type parameter’s identifier when you add a receiver while creating a method.
    • New Find Usages group for type parameters - Added a new Find Usages group for generics: Type parameter declaration.
  • Fuzz testing
    • Running fuzz tests - You can now run fuzz tests from GoLand.
    • Quick-fix to change the Go SDK - In GoLand, you will now no longer see a run button in the gutter if you’ve configured a Go SDK that doesn’t support fuzzing. A quick-fix has been added to change the Go SDK if the current Go SDK doesn't support fuzzing.
  • Go workspaces
    • Quick-fix for grouping multiple use directives - Added a quick-fix that groups multiple use directives in a go.work file into one directive.
  • Go 1.19
    • Support for fmt.Appendf - Added support for fmt.Appendf, and GoLand now identifies formatting verbs inside strings. As a result, the Appendf function benefits from all of the features that formatting functions have, such as the Add a format string argument intention action.
    • Support for the unix build constraint - GoLand now supports the new unix build tag, which recognizes any Unix or Unix-like system.
    • Addition of loong64 to the Arch list - Go 1.19 introduces a new architecture - loong64. It has been added to the Arch list in Settings | Go | Build Tags & Vendoring.
  • Quick Documentation
    • Improved Quick Documentation:
      • For each of the 25 Go keywords, GoLand now displays a meaningful keyword tooltip outlining the semantics of the relevant keyword.
      • Channel direction information is now displayed. This data is shown in tooltips in three places: when you hover over the chan keyword, on channel send and receive operations, and on all references to channel types.
      • Quick Documentation for iota now contains additional information about how to use it. If a constant is part of an iota group, the value is now shown in the completion box, even if the constant is defined implicitly.
      • Added a new tooltip explaining how type switches work.
      • If you invoke Quick Documentation on a type parameter, GoLand will now show you a tooltip with a brief explanation of how generics work and a link to a tutorial by the Go team.
      • The tooltip for type assertions now contains additional information about them and offers examples.
      • GoLand now displays additional information when you initialize maps, arrays, slices, and structs if you hover over the area inside the curly braces.
      • If you hover over a blank identifier, GoLand now shows a tooltip with information about what the blank identifier is and how it works.
  • More Go-related improvements
    • Performance optimization - GoLand no longer scans the cache subdirectory in ~/go/pkg/mod since it doesn’t contain information needed for the IDE to work correctly. This folder can be fairly large, and excluding it from the scan will improve performance.
    • Support for the go:linkname directive - Added support for the go:linkname compiler directive: //go:linkname localname [importpath.name]. It instructs the compiler to use importpath.name as the object file symbol name for the variable or function declared as localname in the source code.
    • Irregular usage of iota inspection - Added a new inspection in GoLand that will warn you if iota is used irregularly. The Reserved word used as name inspection for iota and other built-in constants has been enabled. The inspection will be triggered if you try to assign a value to a constant named iota, true, or false.
    • Inspection for methods on both value and pointer receivers - The Go documentation recommends that all methods on a given type should have either value or pointer receivers. A new inspection in GoLand has been added that will warn you if your type has methods on both value and pointer receivers.
  • Automatic SQL detection
    • SQL statements are now automatically detected and the language is injected into every string literal that matches a certain pattern. When you inject a language into a string literal, you get comprehensive code assistance when editing that literal.
  • Run Anything
    • GoLand now supports the Run Anything action that allows you to quickly launch run/debug configurations, applications, scripts, commands, and tasks, as well as open recent projects.
  • HTTP Client
    • Support for WebSocket endpoints - GoLand now supports WebSocket connections. You can create requests as well as send and receive messages.
    • Support for GraphQL endpoints - GoLand can now send GraphQL queries over HTTP and WebSocket protocols out of the box. For http:// and https://, simple HTTP requests are used, while ws:// and wss:// are delegated to the WebSocket executor.
    • Select a run environment - Added the ability to select a run environment from the play icon on the gutter.
  • Remote development
    • Updated the Remote Development section on GoLand’s Welcome screen. Here you can choose your preferred method for backend orchestration. Also, the port forwarding functionality is now available for processes running on the terminal.
  • Space
    • JetBrains Space is a complete software development platform that provides project management, issue tracking, Git hosting, code reviews, continuous integration, package repositories, and remote backend orchestration for JetBrains IDEs through dev environments. Space integration is now bundled with GoLand. With this first-class integration, you can browse Space projects and clone repositories, then start working on them directly. When your changes are ready, you can create a merge request and perform a code review from within the IDE. You can now manage your Space dev environments for remote development directly within GoLand. When your IDE is connected to your Space organization, all of your existing dev environments are synchronized. You can create a new dev environment for a repository and branch, and start coding right away. You can hibernate a dev environment to reduce resource consumption or simply delete it when your work is finished.
  • User interface
    • Merge All Project Windows action on Apple macOS - For macOS, the ability to organize your working space by merging all opened project windows into one has been added, turning each window into its own tab.
    • Keyboard shortcut to change the font size globally - Added the ability to change the font size across the whole editor with a keyboard shortcut. You can now press Alt+Shift+. to increase the font size. Press Alt+Shift+, to decrease it.
    • New Description field for mnemonic bookmarks - A Description field has been integrated into the Add Mnemonic Bookmark dialog so that you can add an optional description to your bookmark.
    • Cloning repository progress bar - The Cloning repository progress bar is now shown right in the Projects list.
    • Faster access to Code Completion Settings - You can now access Code Completion Settings from the vertical ellipsis menu button in the code completion popup.
  • Editor
    • Control automatic parentheses insertion - Added the option to toggle whether the IDE automatically inserts parentheses during code completion.
    • Change the highlighting style for inspections - You can now adjust the highlighting style for inspections using the new Highlighting in editor dropdown menu in Settings | Editor | Inspections. This provides you with more options for customizing inspections. For example, you can set the severity level of a particular inspection to Warning but change the highlighting style to Error.
  • Docker
    • Copy Docker Image - You can now copy images from one Docker daemon to another using the new Copy Docker Image action, which saves the image to a file and then pushes it to the chosen connection.
    • Docker auto-connection on IDE restart - GoLand now automatically connects to Docker after you restart the IDE. This new setting is enabled by default in Settings | Advanced Settings | Docker.
    • Integration with Colima and Rancher - GoLand is now integrated with Colima and Rancher to support more options for establishing connections to a Docker daemon.
  • Databases
    • Option to import multiple CSV files - You can now select several CSV files and import them all at once.
    • Resolve modes for databases - When working with databases, you now have two file resolve modes: Playground and Script. Playground is for when you have a set of unconnected queries, and Script is for queries that have sequential logic.
  • Other improvements
    • Import trusted SSL certificates - GoLand can now help you import trusted SSL certificates from system trust stores. It will automatically use the custom certificates specific to your enterprise environment. You don’t need to perform any additional actions. Everything should work right out of the box.
    • Clickable URLs in JSON and YAML files - JSON and YAML files now feature automatically inserted web references inside values that start with http:// and https://. You can open these links in a web browser and generate requests in the HTTP client.
New Generics features

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.