GoLand 2023.1 introduces the vulnerability checker, better navigation in gRPC code, and Rename refactoring for generic receivers.
You can now run scratch files with non-standard-library packages, use regular expressions to create your own search and replace inspections, as well as quickly convert raw string literals to double-quoted ones and vice-versa. The Implement interface intention action now works for unexported interfaces.
Apart from that, you will find several improvements for our new UI, updates for Docker and Kubernetes, and improvements for web development.
If you prefer an interactive approach to learning, we invite you to complete the What's New in GoLand 2023.1 tutorial from the Welcome screen.
GoLand can now highlight packages with known vulnerabilities in go.mod
.
Hover over the highlighted code or press Alt+Enter,
choose Show vulnerability info for …, and GoLand will show you
a list of vulnerabilities with links to the detailed description.
The data about vulnerabilities is provided
by the software security company Checkmarx.
You can place the cursor on a highlighted package in go.mod
,
press Alt+Enter, and choose the
Change package-name version to v0.x.x quick-fix to
update a dependency to a version that doesn't have vulnerabilities.
GoLand also highlights method calls from packages with known vulnerabilities right in your editor. You can hover over highlighted code and see a popup with information about the vulnerability and a link to the detailed description.
You can access it via Code | Analyze Code | Show Vulnerable Dependencies.
GoLand’s HTTP Client currently supports running gRPC requests. You can also run gRPC requests from the Endpoints tool window.
This version offers another valuable addition to our
gRPC feature set. You can now navigate and access declarations of
messages, services, and methods from Go code and their Go implementations
from .proto
files.
For this, click the dedicated icon next to the declaration of a message, service, method, or their implementation.
You can now run scratch files with non-standard-library Go dependencies.
When you copy your code from a project file to a scratch file
and press the Run button, GoLand creates a Run configuration
with the -overlay
flag. This flag is used with a JSON file
that maps file paths to go.mod
and go.sum
in your original project.
When you rename a type parameter in a struct, the Rename refactoring now suggests changing the receivers accordingly.
We've fixed several issues affecting navigation between interfaces, implementations, and method specifications in generic code. We've also implemented several additional fixes for generics-related false positives and false negatives.
Now, there is an intention action that lets you quickly convert raw string literals – strings that are surrounded by backticks – to double-quoted ones and vice-versa.
Previously, when you needed to convert an integer to a string, GoLand would first suggest the Convert to ‘string’ quick-fix. To complete the conversion correctly, you would then need another quick-fix – Convert integer to string using strconv.Itoa() call.
We’ve simplified this workflow, and now GoLand suggests the Convert integer to string using strconv.Itoa() call quick-fix right away.
The Implement interface intention action now works for unexported interfaces.
GoLand now has an inspection and a quick-fix that will help you to
detect and remove leading spaces in Go directives like //go:embed
.
In the previous release, we enabled the Intention Preview functionality by default.
This feature lets you instantly see how your code will be altered once you apply the IDE’s suggestions.
It is now possible to preview a broader range of intention actions and quick-fixes: Introduce local variable, Create variable/global variable, Create constant/global constant, Create field, Merge declaration up, Delete all unused parameters, Create function, Create method, Fill all fields.
We’ve improved the IDE startup experience by performing the Scanning files to index… process in smart mode, which makes the IDE’s full range of functionality available much earlier in the startup process. When opening a project, GoLand uses existing caches from your previous session with the project and simultaneously looks for files to index. If no changes are found in the scan, the IDE will be fully ready for you to work, eliminating the delays that were previously caused by indexing on startup.
There’s a new notification triggered when Windows Defender with Real-Time Protection is running. Given that these antivirus checks can significantly decrease the IDE speed, GoLand suggests adding specific folders to Defender’s list of exclusions. The notification provides options to either reconfigure these settings automatically or first check the Defender configuration instructions and do it manually.
We’ve updated the Code Vision feature. GoLand now shows the number of implementations for an interface and its method specifications.
In the previous version, we introduced usages displayed near all functions and types showing how often the function or type is referenced in the current project. Also, the code authors are displayed if version control integration is enabled.
You can now use regular expressions to create your own search and replace inspections. These inspections can be especially useful for highlighting style-based or formatting-based problems.
Go to Settings | Editor | Inspections and press the + icon. Select Add RegExp Search Inspection from the list, and you’ll be directed to a dialog where you can set up your new inspection. Select the desired language, use hints from the panel on the left to build a RegExp, and designate the required replacement. You can also specify how you want the IDE to highlight them in the project.
In the 2022.3 version, we integrated the Go Playground functionality into GoLand.
In this version, we’ve improved that feature. First of all, shared URLs now include the version parameter if you choose the dev or previous versions.
We’ve also added an option to turn off the popup window that asks your permission to share code in the Playground. You can disable it in Settings | Go | Ask before sharing in Go Playground.
We’ve fine-tuned the user experience when pasting a line that was copied or cut without selection. There’s now a special setting that allows you to control the placement of the pasted content.
In Settings | Advanced Settings, find the Editor section and select the desired behavior for the Paste action from the drop-down list.
There’s a new Selection checkbox in Settings | Editor | General | Appearance | Show Whitespace that allows you to configure this setting so that the IDE shows whitespaces as small dots only when you select code.
We’ve updated the Typo inspection so that it no longer checks the spelling of hashes and special values and doesn’t report them as misspelled. This update covers the following values:
We’ve introduced a new Find Usages group for function calls – the Call group.
We’ve also implemented some fixes for how generic code element usage is represented in the Find Usages window.
It’s now possible to zoom into and out of GoLand entirely, increasing or decreasing the size of all UI elements at once. From the main menu, select View | Appearance | Switch Zoom IDE and adjust the IDE’s scaling.
We’ve introduced a new layout option that allows you to unify the width of the side tool windows or retain the ability to freely adjust their sizes as you customize your layout. The new Remember size for each tool window checkbox is available in Settings | Appearance | Appearance & Behavior | Tool Windows.
In the new UI, the setting is switched off by default, meaning that the tool windows are displayed with a unified width, and their sizes remain constant when you switch between them. In the old UI, the option is switched on, so the tool windows have different widths, though you can choose to align them at any time simply by turning the setting off.
You can now save and manage several tool window layouts and switch between them when needed.
To save a new layout, arrange the tool windows as desired and go to Window | Layouts | Save Current Layout as New. Once you adjust the arrangement, you can either update the currently used setup using the Save Changes in Current Layout option or save these changes for another custom layout. To activate a saved layout, find it in the list in Window | Layouts, hover over its name, and click Apply.
This version adds an option to predefine the behavior of Actions on Save for new projects.
For this, go to File | New Projects Setup | Preferences For New Projects | Tools | Actions on Save and select which actions you want to be triggered when saving changes in your projects.
Last year, we introduced a new, more minimalist UI for GoLand and other JetBrains IDEs. We’ve been refining the new UI further based on your feedback. Read on to find out about the key changes to the new UI that have landed in this release. You can try our new UI by ticking the New UI checkbox in Settings | Appearance & Behavior.
Visit this page to learn more about the new UI.
To improve the user experience with our new UI on smaller screens, we’ve introduced Compact Mode, which provides a more consolidated look and feel due to the reduced heights for toolbars and tool window headers, scaled-down spacings and paddings, and smaller icons and buttons.
To turn Compact Mode on, go to the View menu and select Appearance | Compact Mode.
Also, the top toolbar is no longer visible in Zen and Distraction Free modes.
For the new UI, we’ve introduced the option to split the tool window area so that you can conveniently arrange these windows.
To add a tool window to this area and place it in the lower part, drag its icon along the sidebar and drop it under the separator. Alternatively, you can right-click on an icon to call the context menu and assign the new position for a tool window using the Move to action.
When you have several projects open, you can now easily switch between them using project tabs displayed under the main toolbar. To do this, go to Window | Merge All Project Windows.
We’ve added the Show Hidden Tabs feature in the new UI. You now have a drop-down showing the complete list of open tabs, as they may have been hidden before.
We’ve fine-tuned the user experience of the new UI by adding a pane that displays the name of the file that is currently open when editor tabs are hidden.
We’ve redesigned the Run widget at the top of the IDE window. With the icons now colored green – rather than the area around them being blocked out in color – the appearance is subtler and easier on the eyes.
In this build, we’ve added completion for container
names when you use the testcontainers-go
package.
After typing in the container name, you can use the Pull Docker image action that was implemented earlier.
The Dashboard tab of the Docker-compose node now pulls together logs from every Docker Compose container and displays them all in one place, updated in real time.
You can now easily connect to Azure Container Registry. Go to Settings | Build, Execution, Deployment | Docker | Docker Registry and set it up by selecting the Docker V2 option in the Registry input field.
Now you can add :z configuration flags to Docker bind mounts, which allows you to connect volumes to Docker containers on SELinux workstations. To enable this functionality, go to Settings | Advanced Settings | Docker.
To make creating new Kubernetes files easier, we’ve added a new action – Kubernetes Resource – to the New menu that appears when you right-click in the Project tool window.
Once you select the Kubernetes Resource option, you’ll see a popup that features a list of the most popular resource types, such as Pod, Deployment, ConfigMap, etc.
We’ve introduced a new dialog to create Kubernetes Secrets.
To define a new secret, you can input a key and value manually. Alternatively, you can specify a file whose content will be used for the value of the resulting secret.
When you use the View YAML action for resources from a cluster and make any changes in the opened file, the IDE highlights all of your edits with color-coded marks in the gutter. This way, you can be sure that the changes are made to the required parts of the resource before you apply them back to the cluster.
Additionally, using the Compare with Cluster icon, you can open a full diff view that will fetch the resource’s current version from the cluster and compare it with the local version.
You can now easily access a kubeconfig file in the Services view and open it in the editor. If you change a kubeconfig file outside of GoLand, the IDE will detect this and automatically refresh its configuration in the Services tool window. Furthermore, the IDE now supports both code highlighting and completion for kubeconfig files.
You can now assign shortcuts for most Kubernetes actions in the Services view, like Forward Ports, Delete Resource, and Describe Resource, among others. To set your custom shortcuts, go to Settings | Keymap | Plugins | Kubernetes.
A new intention action allows you to correct the formatting of tables in Markdown files. You can access the quick-fix via the shortcut Alt+Enter or by pressing the yellow bulb icon and selecting Reformat table from the list that appears.
The Fill Paragraph editor action is now supported for Markdown files, allowing you to break long texts into several lines of even length. To do this, set the caret inside the paragraph you want to edit and call the action from the Edit menu or search for the Fill Paragraph command using Search everywhere (Double Shift) and execute it.
We’ve added a dedicated page for configuring and editing your Markdown preferences in Settings | Editor | General | Smart Keys. This page should make it easier to manage your preferences, as it provides separate checkboxes for various editor features, replacing the single checkbox previously stored in Settings | Languages & Frameworks.
We’ve improved the usability of the Branches popup. For instance, navigating between branches is now easier, as they are grouped and stored in expandable lists.
We’ve implemented completion in the Create New Branch popup. Press Ctrl+Space, and the IDE will suggest relevant prefixes based on the names of existing local branches.
To make tracking changes to files more convenient, we’ve added color hints to the Structure tool window. The names of modified objects will now become blue, and the names of the newly added objects will appear in the tool window highlighted in green.
We’ve reworked the behavior of the commit checks for Git and Mercurial to speed up the overall commit process. Checks are now performed in the background after you commit but before you push.
We’ve reworked the Pull Request tool window. It now features a dedicated tab for each pull request you open. The tab instantly displays the list of changed files but now provides less information than before. This allows you to better focus on your current task. There is now also a dedicated button to easily execute the action that’s considered the most important given the pull request’s current state.
Astro support has landed in GoLand. You can get it through our new Astro plugin that can be installed from Settings | Plugins. The plugin provides basic functionality, including syntax highlighting, code completion with automatic imports, refactorings, navigation, correct formatting, and more.
GoLand will now automatically transform your single- or
double-quoted strings into template literals whenever you type ${
.
This works for raw strings as well as for JSX properties.
We’ve added TypeScript support in Vue templates
when you set the lang
attribute in a script
tag to ts
.
Previously, JavaScript was used regardless of the
lang
attribute in the script
tag.
Note: to learn about all of the web development improvements in the 2023.1 version, head over to the WebStorm What's New page.