{"id":160270,"date":"2021-07-08T14:18:03","date_gmt":"2021-07-08T13:18:03","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=go&#038;p=160270"},"modified":"2022-05-23T18:51:55","modified_gmt":"2022-05-23T17:51:55","slug":"goland-2021-2-reaches-beta","status":"publish","type":"go","link":"https:\/\/blog.jetbrains.com\/zh-hans\/go\/2021\/07\/08\/goland-2021-2-reaches-beta","title":{"rendered":"GoLand 2021.2 Reaches Beta!"},"content":{"rendered":"\n<p>GoLand 2021.2 Beta is out! This means that we have stopped adding new features and are now focusing on perfecting the release.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"400\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/07\/Blog_Image_GoLand.png\" alt=\"\" class=\"wp-image-160304\"\/><\/figure>\n\n\n\n<p>The Beta version is quite stable in comparison to Early Access Program builds, but please keep in mind that there may still be some small issues with it.&nbsp;<\/p>\n\n\n\n<p>This is the last build in the EAP cycle that does not require a subscription.&nbsp;<\/p>\n\n\n\n<p>For this release, we focused on adding new features for Go modules. There is also a new option for formatting, support for Go 1.17 features, and support for generics in <em>.go<\/em> files. We\u2019ve added new quick-fixes, including one that will help you to use the new <code>\/\/go:build<\/code> syntax correctly.<\/p>\n\n\n\n<p>You\u2019ll find version control updates, including the ability to sign Git commits with GPG keys. There are also some UI improvements, such as a better view of attached projects. For web developers, pages will reload in the browsers when code is saved, and there is completion for MongoDB fields and operators.&nbsp;<\/p>\n\n\n\n<p>You can get the build via the<a href=\"https:\/\/www.jetbrains.com\/toolbox\/app\/\" target=\"_blank\" rel=\"noopener\"> Toolbox App<\/a>, download it from our<a href=\"https:\/\/www.jetbrains.com\/go\/nextversion\/\" target=\"_blank\" rel=\"noopener\"> website<\/a>, or use a snap package (for Ubuntu). You can also update from within GoLand. Just select <em>Automatically check updates for Early Access Program<\/em> in <em>Settings\/Preferences | Appearance &amp; Behavior | System Settings | Updates<\/em>.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/www.jetbrains.com\/go\/nextversion\/\" class=\"ek-link jb-download-button\" target=\"_blank\" rel=\"noopener\">Download GoLand 2021.2 Beta<\/a><\/p>\n\n\n\n<p>If you would like an interactive introduction to the new features in this GoLand release, the new <em>What\u2019s New in GoLand 2021.2<\/em> course is available on the <em>Learn GoLand<\/em> tab of the <em>Welcome<\/em> screen. You\u2019ll also find our new <em>Onboarding tour <\/em>there. It can help you quickly get acquainted with GoLand, and it will give you an overview of how to run and debug code and how to use the IDE\u2019s features.&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"go-modules\">Go Modules<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"load-gomod-changes-manually\">Load go.mod changes manually<\/h3>\n\n\n\n<p>Previously, when you edited <em>go.mod<\/em> files, GoLand would automatically run <em>go list<\/em> commands after every modification. This obstructed the editing process, especially in large projects.&nbsp;<\/p>\n\n\n\n<p>You can now control this behavior. If you don\u2019t want GoLand to run <em>go list<\/em> commands automatically, go to <em>Preferences\/Settings | Build, Execution, Deployment | Build Tool<\/em>s, where you\u2019ll find the <em>Reload project after changes in the build scripts<\/em> checkbox.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-40.png\" alt=\"\" class=\"wp-image-249046\"\/><\/figure>\n\n\n\n<p>If you select the <em>External changes<\/em> option, <em>go list<\/em> commands won\u2019t be executed automatically when you edit files inside GoLand. You will instead see a <em>Load Go modules Changes<\/em> icon, which you can click to load the changes when you are finished editing.&nbsp;&nbsp;<\/p>\n\n\n\n<p>If you untick the <em>Reload project after changes in the build scripts<\/em> checkbox, you will see the <em>Load Go modules Changes<\/em> icon on all types of changes \u2013 both external and internal ones.&nbsp;<\/p>\n\n\n\n<p>We believe that there is no need to disable automatic reloading, but if you find it useful to do so, please get in touch with us. We would love to know more about your use cases.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-41.png\" alt=\"\" class=\"wp-image-249058\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"better-support-for-different-go-versions\">Better support for different Go versions<\/h3>\n\n\n\n<p>If you use features from a version of the Go language that is newer than the one specified in your <em>go.mod<\/em> file, you\u2019ll get an error, and GoLand will tell you what\u2019s wrong.<\/p>\n\n\n\n<p>For numeric literals and \/\/go:embed statements, a quick-fix is available that will change the Go version in <em>go.mod<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-10.gif\" alt=\"\" class=\"wp-image-249057\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"dealing-with-unused-dependencies\">Dealing with unused dependencies<\/h3>\n\n\n\n<p>There may be situations where you need to specify a module that isn\u2019t used anywhere in your code in a <em>replace<\/em> directive.&nbsp;<\/p>\n\n\n\n<p>These unused dependencies used to be highlighted in red. Now, to help distinguish them from errors, they are highlighted in grey. If you hover over one of the grey lines, you will see an \u201cUnused dependency\u201d message.<\/p>\n\n\n\n<p>If you need to download the unused modules, press <em>Alt + Enter<\/em> (<em>\u2325 + &#x21a9;<\/em>) and choose the <em>Download all modules to the module cache<\/em> option. You can also download individual modules.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/handling-unused-dependencies.gif\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"formatter\">Formatter<\/h2>\n\n\n\n<p>Go has the <em>gofmt<\/em> tool for formatting your code, and GoLand also has its own formatter.&nbsp;<\/p>\n\n\n\n<p>There are various <a href=\"https:\/\/www.jetbrains.com\/help\/go\/2021.1\/integration-with-go-tools.html#gofmt\" target=\"_blank\" rel=\"noopener\">ways to enable \u201cgofmt\u201d<\/a> in GoLand, but users have regularly asked us to make enabling it more discoverable or to set it to be used by default.&nbsp;<\/p>\n\n\n\n<p>In this release, we have introduced the <em>Run gofmt on code reformat<\/em> option. It\u2019s enabled by default and can be toggled in <em>Preferences\/Settings | Editor | Code Style | Go<\/em>.&nbsp;<\/p>\n\n\n\n<p>When this option is checked, you can invoke both formatters with the shortcut <em>Ctrl + Alt + L<\/em> (<em>\u2318 + <\/em><em>\u2325 + <\/em><em>L<\/em>), and \u201cgofmt\u201d will be run after GoLand\u2019s formatter. This will apply both the user settings and the default style.<\/p>\n\n\n\n<p>This is just our first step towards making gofmt more discoverable. We have more changes planned.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"618\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-42.png\" alt=\"\" class=\"wp-image-249079\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"go-117\">Go 1.17<\/h2>\n\n\n\n<p>In Go 1.17 it will be possible to <a href=\"https:\/\/tip.golang.org\/doc\/go1.17#language\" target=\"_blank\" rel=\"noopener\">convert a slice to an array pointer<\/a>. GoLand will not mark these conversions as errors. To try out the Go 1.17 features, change GOROOT to \u201cGo 1.17beta1\u201d in <em>Preferences\/Settings | Go<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/go-117.gif\" alt=\"\" class=\"wp-image-249369\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"generics-aka-type-parameters\">Generics a.k.a. type parameters<\/h2>\n\n\n\n<p>We\u2019ve been providing experimental support for generics since GoLand 2020.2. You can turn this feature on using the <em>Enable generics (experimental support for type parameters)<\/em> setting in <em>Settings\/Preferences | Go<\/em>.&nbsp;<\/p>\n\n\n\n<p>The experimental support for generics in GoLand used to only be available in files with the <em>.go2 <\/em>extension. Now GoLand supports type parameters in <em>.go<\/em> files, too. It no longer suggests renaming the file, but you will still need to enable support for generics in the settings or through a quick-fix.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/generics-aka-type-parameters.gif\" alt=\"\" class=\"wp-image-249380\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"more-quick-fixes\">More quick-fixes&nbsp;<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"support-for-the-new-gobuild-constraints-formatting\">Support for the new \/\/go:build constraints formatting<\/h3>\n\n\n\n<p>Last year, the authors of Go suggested that <code>\/\/+build<\/code> constraints syntax <a href=\"https:\/\/go.googlesource.com\/proposal\/+\/master\/design\/draft-gobuild.md#transition\" target=\"_blank\" rel=\"noopener\">should be changed<\/a> to the new <code>\/\/go:build<\/code> syntax.<\/p>\n\n\n\n<p>During this transition period, according to the new syntax, you can only place <code>\/\/go:build<\/code> constraints at the top of the file. If you place them anywhere else in the file, GoLand will suggest a quick-fix that will move the <code>\/\/go:build<\/code> lines to their proper location.&nbsp;<\/p>\n\n\n\n<p>In Go 1.16, you have to use the old syntax or both of them. We recommend getting used to the new one though. You can write <code>\/\/go:build<\/code> lines, and if there are no <code>\/\/+build<\/code> lines, GoLand will suggest a quick-fix that generates them.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/support-for-go-build-constraints-formatting.gif\" alt=\"\" class=\"wp-image-249391\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"enable-cgo-support-with-one-click\">Enable cgo support with one click&nbsp;<\/h3>\n\n\n\n<p>If you imported the \u201cC\u201d package but forgot to enable <em>cgo <\/em>support in the project settings, the IDE will display a banner with the <em>Enable cgo support<\/em> quick-fix.&nbsp;&nbsp;<\/p>\n\n\n\n<p>There is also the <em>Navigate to cgo import<\/em> option, which will put the cursor at the beginning of the package\u2019s name. This can help you find the <em>import<\/em> statement in a big project.&nbsp;<\/p>\n\n\n\n<p>There is also the option to<em> Edit Go project settings,<\/em> which opens a window with the settings for <em>Build Tags and Vendoring<\/em>, and you can enable <em>cgo<\/em> support, among other things.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/enable-cgo-support-with-one-click-3.gif\" alt=\"\" class=\"wp-image-249551\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"debugger\">Debugger<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.jetbrains.com\/help\/go\/using-code-editor.html#preview-tab\" target=\"_blank\" rel=\"noopener\">Preview mode<\/a> now works when you debug your application. It lets you open files successively in one tab. This helps you avoid cluttering the editor with multiple open files in separate tabs.&nbsp;<\/p>\n\n\n\n<p>To enable preview mode during debugging, go to <em>Preferences\/Settings | Editor | General | Editor Tabs<\/em> and tick the <em>Enable preview tab<\/em> checkbox.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"640\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/debugger-1.gif\" alt=\"\" class=\"wp-image-249528\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"quick-navigation\">Quick navigation<\/h2>\n\n\n\n<p>Starting with this release, you can <em>Navigate to implementations<\/em> of the interfaces contained in the <em>internal<\/em> folder. Click on the gutter to jump to the implementations. You can also jump back to the interface from its implementations.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-17.gif\" alt=\"\" class=\"wp-image-249344\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"vcs-updates\">VCS updates&nbsp;<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"gpg-signature\">GPG signature<\/h3>\n\n\n\n<p>You can sign your commits with a GPG key to secure them. This feature can be enabled via <em>Preferences\/Settings | Version Control | Git<\/em>. If this is your first time using a GPG key, you\u2019ll need first to <a href=\"https:\/\/docs.github.com\/en\/github\/authenticating-to-github\/managing-commit-signature-verification\/generating-a-new-gpg-key\" target=\"_blank\" rel=\"noopener\">configure it<\/a>. With an existing preconfigured GPG key, you just need to select it from the drop-down list.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-50.png\" alt=\"\" class=\"wp-image-249178\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"new-options-in-pre-commit-checks\">New options in pre-commit checks<\/h3>\n\n\n\n<p>You can now <em>Run tests<\/em> and <em>Analyze code<\/em> before committing your changes. Go to <em>Preferences\/Settings | Version Control | Commit | Before commit <\/em>or click on the gear icon in the <em>Commit<\/em> view<em>. <\/em>GoLand will show the progress and the results of pre-commit checks in the <em>Commit<\/em> area without opening additional modal windows. Please be aware that the <em>Run tests<\/em> option is only available if you tick the <em>Use non-modal commit interface<\/em> box in <em>Preferences\/Settings | Version Control | Commit<\/em>.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"610\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-45.png\" alt=\"\" class=\"wp-image-249123\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"new-search-field-in-local-history-menu\">New search field in Local history menu<\/h3>\n\n\n\n<p>We\u2019ve improved the <em>Local History<\/em> menu, which helps you track changes independently of version control. We\u2019ve added a new search field to it to help you to quickly find the text you are looking for in your <em>Local History<\/em> revisions. To try it out, right-click on the file and go to <em>Local History | Show History<\/em>. Please note that <em>Local History<\/em> shouldn\u2019t be used as a substitution for VCS. We recommend making VCS your default choice for tracking changes and using <em>Local History<\/em> as a last resort.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"602\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/new-search-field-in-local-history-menu.gif\" alt=\"\" class=\"wp-image-249516\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"changelists-renamed\">Changelists renamed<\/h3>\n\n\n\n<p>GoLand has been using \u201cDefault Changelist\u201d as the name for the node that stores all uncommitted changes. We\u2019ve made the phrasing more precise by using the word \u201cChanges\u201d instead of \u201cDefault<em> <\/em>Changelist\u201d. This update will be available by default in your new projects.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-43.png\" alt=\"\" class=\"wp-image-249101\"\/><\/figure>\n\n\n\n<p>The IDE will no longer add changelists automatically for Git operations. So, for example, a cherry-pick won\u2019t trigger the creation of a changelist.&nbsp;<\/p>\n\n\n\n<p>If you prefer automatic changelist creation, you can activate it in <em>Preferences\/Settings | Version Control<\/em> by ticking the <em>Create changelists automatically <\/em>checkbox.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-51.png\" alt=\"\" class=\"wp-image-249189\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ui-improvements\">UI improvements&nbsp;<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"clearer-understanding-of-go-and-gopath-projects-on-the-welcome-screen\">Clearer understanding of Go and GOPATH projects on the Welcome screen<\/h3>\n\n\n\n<p>As GOPATH-based projects are becoming less and less popular, the way projects were previously named is no longer suitable. We\u2019ve made the Go project the default for Go modules and renamed GOPATH-based projects to Go (GOPATH).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-47.png\" alt=\"\" class=\"wp-image-249145\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"better-view-of-attached-projects\">Better view of attached projects&nbsp;<\/h3>\n\n\n\n<p>Previously, when you attached projects, they would be represented in the <em>Project <\/em>view as child directories of the existing project. We decided to change that because the actual location of these projects on your computer could be very different from what was shown in GoLand. Attached projects will now appear in the <em>Project <\/em>view as separate directories.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-46.png\" alt=\"\" class=\"wp-image-249134\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"advanced-settings-and-navigation-arrows\">Advanced settings and navigation arrows<\/h3>\n\n\n\n<p>We\u2019ve added a new <em>Advanced Settings <\/em>node<em> <\/em>to <em>Preferences\/Settings<\/em>. It contains additional configuration options, allowing you to, for example, configure a left margin for <em>Distraction-free<\/em> mode.&nbsp;<\/p>\n\n\n\n<p>There is also a new navigation option in <em>Preferences\/Settings<\/em>. You can now navigate back and forth between sections using the arrows in the top right corner of the window.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"601\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-44.png\" alt=\"\" class=\"wp-image-249112\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"update-notifications-from-the-toolbox-app\">Update notifications from the Toolbox App<\/h3>\n\n\n\n<p>With this feature, you won\u2019t miss any important updates from our Toolbox App. GoLand will inform you when a new version is available and give you the option to update to the new version right from the IDE. You need to have Toolbox App version 1.20.8804 or later for this. &nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"610\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-53.png\" alt=\"\" class=\"wp-image-249212\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"new-terminal-options\">New terminal options<\/h3>\n\n\n\n<p>You can change the cursor shape in the built-in terminal to <em>underline <\/em>or <em>vertical<\/em> by going to <em>Preferences\/Settings | Tools | Terminal<\/em>.<\/p>\n\n\n\n<p>There is also a new option in the <em>Terminal <\/em>settings: we now support the <em>Use Option as Meta key <\/em>option. The Meta key temporarily modifies the normal action of another key when they are pressed together. Using the Meta key will help if you use the terminal a lot.<\/p>\n\n\n\n<p>For instance, you can now use the following shortcuts to cut down on the time you spend navigating through the terminal:&nbsp;<\/p>\n\n\n\n<ul><li><em>Option + F<\/em> \u2013 go to the next word<\/li><li><em>Option + B<\/em> \u2013 go back a word<\/li><li><em>Option + D<\/em> \u2013 delete the next word<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-52.png\" alt=\"\" class=\"wp-image-249201\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"new-change-project-icon-window\">New <em>Change Project Icon<\/em> window<\/h3>\n\n\n\n<p>We\u2019ve streamlined the dialog that allows you to customize your project icon in the projects list on the <em>Welcome<\/em> screen. To upload a custom icon, just right-click on any project and select <em>Choose project icon<\/em> from the context menu.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-54.png\" alt=\"\" class=\"wp-image-249223\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"web-development\">Web development&nbsp;<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"browser-pages-reload-on-save\">Browser pages reload on save<\/h3>\n\n\n\n<p>As you may know, GoLand lets you preview HTML files in a browser using the built-in web server. The IDE can now update the page in a browser as you edit and save HTML, CSS, or JavaScript files.&nbsp;<\/p>\n\n\n\n<p>To give this feature a try, open an HTML file, click on the icon of your favorite browser in the top right-hand corner of the window, and make some changes to your project.&nbsp;<\/p>\n\n\n\n<p>Page reloading is turned on by default. If you want to turn it off, go to <em>Preferences\/Settings | Build, Execution, Deployment | Debugger<\/em> | <em>Built-in Server<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/browser-pages-reload-on-save-1.gif\" alt=\"\" class=\"wp-image-249504\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"code-completion-for-private-npm-packages\">Code completion for private npm packages<\/h3>\n\n\n\n<p>Adding new project dependencies in <em>project.json<\/em> has become easier, as code completion now works for private npm packages. The IDE will let you browse information about the latest versions of the package, just like it does for public packages.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-56.png\" alt=\"\" class=\"wp-image-249245\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"generic-support-for-web-types\">Generic support for web-types<\/h3>\n\n\n\n<p>We are introducing a new version of web-types \u2013 an open-source standard for documenting various web frameworks. Its initial version was focused only on Vue.js support. <a href=\"https:\/\/blog.jetbrains.com\/zh-hans\/webstorm\/2021\/01\/web-types\">This blog post<\/a> from the WebStorm team describes web-types in more detail.&nbsp;<\/p>\n\n\n\n<p>With this release, we want to build a new architecture to make it easier to support new JavaScript frameworks and extend support for the existing frameworks. The WebStorm team <a href=\"https:\/\/blog.jetbrains.com\/zh-hans\/webstorm\/2021\/06\/webinar-recording-web-types-for-vue-and-beyond\">recorded a webinar<\/a> that will help you to understand how you can use web-types in your projects.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-48.png\" alt=\"\" class=\"wp-image-249156\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"support-for-typescript-types-in-jsdoc-comments\">Support for TypeScript types in JSDoc comments<\/h3>\n\n\n\n<p>We reworked and expanded the support for TypeScript syntax used within JSDoc comments in <em>.js<\/em> files. GoLand recognizes more syntactic constructs, and we\u2019ve fixed a lot of known issues, too. For example, optional properties in <em>@typedef<\/em> declarations are now supported.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-57.png\" alt=\"\" class=\"wp-image-249267\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"the-rename-refactoring-now-works-for-react-hooks\">The <em>Rename<\/em> refactoring now works for React hooks<\/h3>\n\n\n\n<p>You will no longer need to spend a lot of time refactoring <em>useState<\/em> values and functions one by one in React hooks \u2013 GoLand can now rename them for you! Just place the caret on a state value and invoke the <em>Rename<\/em> refactoring with <em>\u21e7F6 \/ Shift+F6<\/em> or<em> <\/em>by going to <em>Refactor | Rename<\/em> from the right-click context menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/rename-refactoring-for-react-hooks.gif\" alt=\"\" class=\"wp-image-249481\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"work-with-databases\">Work with databases<\/h2>\n\n\n\n<p><em>Code completion<\/em> now works in the MongoDB console for fields, nested fields, and fields inside <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/operator\/aggregation\/\" target=\"_blank\" rel=\"noopener\">aggregation expressions<\/a>. It also works for <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/operator\/query\/\" target=\"_blank\" rel=\"noopener\">query and projection<\/a> operators, <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/operator\/update\/\" target=\"_blank\" rel=\"noopener\">update<\/a> operators, and <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/operator\/aggregation-pipeline\/\" target=\"_blank\" rel=\"noopener\">aggregation stages<\/a>.&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/work-with-databases-1.gif\" alt=\"\" class=\"wp-image-249470\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"other-changes\">Other changes&nbsp;<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"ui-in-chinese-japanese-and-korean\">UI in Chinese, Japanese, and Korean<\/h3>\n\n\n\n<p>Starting from this version, you can enjoy the fully localized GoLand UI in <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/13710-chinese-simplified-language-pack-eap\" target=\"_blank\" rel=\"noopener\">Chinese<\/a>, <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/13711-korean-language-pack-eap\" target=\"_blank\" rel=\"noopener\">Korean<\/a>, and <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/13964-japanese-language-pack-eap\/versions\" target=\"_blank\" rel=\"noopener\">Japanese<\/a>. Localization is available as non-bundled language pack plugins, which can be <a href=\"https:\/\/www.jetbrains.com\/help\/go\/managing-plugins.html\" target=\"_blank\" rel=\"noopener\">easily installed in GoLand<\/a>.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"637\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-58.png\" alt=\"\" class=\"wp-image-249278\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"automatic-cache-and-logs-cleanup\">Automatic cache and logs cleanup<\/h3>\n\n\n\n<p>Goland will automatically clean up cache and log directories that were last updated more than 180 days ago. This process won\u2019t affect your system settings and plugin directories. You can clean up the logs and caches manually using the <em>Help | Delete Leftover IDE Directories&#8230;<\/em> action.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-49.png\" alt=\"\" class=\"wp-image-249167\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"intelligent-spelling-and-grammar-checks-in-go-files\">Intelligent spelling and grammar checks in Go files<\/h3>\n\n\n\n<p>We\u2019ve enabled intelligent spelling and grammar checks in Go files by default. These checks are provided by the Grazie plugin, which is bundled with the IDE. To adjust the settings, go to <em>Preferences\/Settings | Editor | Proofreading | Grammar<\/em>, where you will find the <em>Scope<\/em>, <em>Rules<\/em>, and <em>Exceptions<\/em> sections.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/image-55.png\" alt=\"\" class=\"wp-image-249234\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"actions-on-save\">Actions on save<\/h3>\n\n\n\n<p>We\u2019ve collected all the possible on-save actions together in <em>Preferences \/ Settings | Tools | Actions on Save<\/em>. You can now configure all of them there \u2013 just tick the checkbox next to the action you want to enable, and GoLand will trigger it on any save, including both autosave and explicit save actions.<\/p>\n\n\n\n<p>You can also configure the settings for any action more precisely. To do so, hover over it, click the configuration link, and fine-tune this action on the related settings page that appears. Some of these on-save actions were already available via the <em>\u2318S \/ Ctrl+S<\/em> shortcut.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/actions-on-save.gif\" alt=\"\" class=\"wp-image-249447\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"code-with-me\">Code With Me<\/h2>\n\n\n\n<p>You can now keep track of which code completion suggestions GoLand offers to your colleagues during <a href=\"https:\/\/www.jetbrains.com\/code-with-me\/\" target=\"_blank\" rel=\"noopener\">Code With Me<\/a> sessions. To use this feature, you need to be in <em>Following<\/em> mode.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1500\" height=\"600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/05\/code-with-me.gif\" alt=\"\" class=\"wp-image-249436\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Bug-fixes and other improvements<\/h2>\n\n\n\n<p>\u2013 <a href=\"https:\/\/youtrack.jetbrains.com\/issue\/GO-8064\" target=\"_blank\" rel=\"noopener\">GO-8064<\/a> \u2013 Unnecessary package import aliases are no longer introduced when moving files between directories.<\/p>\n\n\n\n<p>\u2013 <a href=\"https:\/\/youtrack.jetbrains.com\/issue\/GO-11137\" target=\"_blank\" rel=\"noopener\">GO-11137<\/a> \u2013 <em>Computing variable presentation<\/em> no longer blocks the debugger when you step over code.<\/p>\n\n\n\n<p>That\u2019s it! Try our new features and tell us what you think. As always, you can leave a comment here, open an issue in <a href=\"https:\/\/youtrack.jetbrains.com\/issues\/GO\" target=\"_blank\" rel=\"noopener\">our tracker<\/a>, tweet us at <a href=\"https:\/\/twitter.com\/GoLandIDE\" target=\"_blank\" rel=\"noopener\">@GoLandIDE<\/a>, or leave a message in the <a href=\"https:\/\/invite.slack.golangbridge.org\/\" target=\"_blank\" rel=\"noopener\">Gophers Slack<\/a> #goland channel.&nbsp;<\/p>\n","protected":false},"author":1254,"featured_media":160680,"comment_status":"closed","ping_status":"closed","template":"","categories":[826],"tags":[6569,91],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/go\/160270"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/go"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/go"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/1254"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=160270"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/go\/160270\/revisions"}],"predecessor-version":[{"id":249562,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/go\/160270\/revisions\/249562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/160680"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=160270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=160270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=160270"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=160270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}