{"id":134709,"date":"2021-04-08T15:55:47","date_gmt":"2021-04-08T14:55:47","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=go&#038;p=134709"},"modified":"2021-04-23T14:44:39","modified_gmt":"2021-04-23T13:44:39","slug":"meet-goland-2021-1","status":"publish","type":"go","link":"https:\/\/blog.jetbrains.com\/zh-hans\/go\/2021\/04\/08\/meet-goland-2021-1","title":{"rendered":"Meet GoLand 2021.1!"},"content":{"rendered":"<p>We are happy to announce the first major release of the year! <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/04\/BlogImageGoLand-2x.png\" alt=\"GoLand 2021.1\" width=\"800\"><\/p>\n<p>GoLand 2021.1 allows you to build and <strong>run your program remotely<\/strong> via Docker, SSH, and WSL 2, use newly supported features from <strong>Go 1.16<\/strong>, including <em>\/\/go:embed<\/em>, as well as quickly generate code from <strong>JSON<\/strong>, <strong>handle errors<\/strong> with ease using new quick-fixes, and much more!<\/p>\n<p>GoLand is more than just a Go IDE \u2013 on top of features for working with Go code, you will get new features for JavaScript, TypeScript, and databases. This is because all the new functionality available in DataGrip and WebStorm is also available in GoLand. Check out <a href=\"https:\/\/www.jetbrains.com\/datagrip\/whatsnew\/\" target=\"_blank\" rel=\"noopener\">DataGrip 2021.1 What\u2019s New<\/a> and <a href=\"https:\/\/www.jetbrains.com\/webstorm\/whatsnew\/\" target=\"_blank\" rel=\"noopener\">WebStorm 2020.1 What\u2019s New<\/a> to read all about the new features. <\/p>\n<p>You can learn more about the new features in GoLand on the <a href=\"https:\/\/www.jetbrains.com\/go\/promo\/whatsnew\/\" target=\"_blank\" rel=\"noopener\">What\u2019s New<\/a> page, which includes a full overview of the release along with GIFs and screenshots of the new features in action.<\/p>\n<p align=\"center\"><a class=\"jb-download-button\" href=\"https:\/\/www.jetbrains.com\/go\/download\/\" target=\"_blank\" rel=\"noopener\"><i class=\"download-icon\"><\/i>Download GoLand 2021.1<\/a><\/p>\n<p>If you want an interactive introduction to the new features, the updated <em>What\u2019s New in GoLand 2021.1<\/em> course is already available on the <em>Welcome<\/em> screen in the <em>Learn GoLand <\/em>tab.<\/p>\n<h1 id=\"what_s_new_highlights\"><strong>What\u2019s New highlights<\/strong><\/h1>\n<h2 id=\"run_targets\"><strong>Run Targets<\/strong> <\/h2>\n<p>In GoLand 2021.1, you can develop remotely without leaving the IDE. Currently, there is support for Docker, SSH, and WSL 2 (Windows subsystem for Linux).<\/p>\n<h2 id=\"go\"><strong>Go 1.16<\/strong><\/h2>\n<ul>\n<li>\nSupport for <em>\/\/go:embed<\/em>: GoLand provides code highlighting, navigation from references inside the embed directive to files and folders in your project, <em>Rename<\/em> refactoring, <em>Find Usages<\/em>, code completion, and a few code inspections.\n<\/li>\n<li>\nCode inspection which detects incorrect usages of asn1.Unmarshal with appropriate quick-fix.\n<\/li>\n<li>\nCode inspection which warns you about invalid calls to the <em>testing.T<\/em> method <em>Fatal<\/em> within a goroutine created during the test with an appropriate quick-fix.\n<\/li>\n<\/ul>\n<h2 id=\"work_with_json\"><strong>Work with JSON<\/strong><\/h2>\n<p>Generate a struct with fields and tags from JSON by simply copy-pasting JSON data into the editor, create JSON and XML tags for all the exported fields in the struct at once, and much more! <\/p>\n<h2 id=\"handle_errors_with_ease\"><strong>Handle errors with ease <\/strong><\/h2>\n<p>The <em>Unhandled Error<\/em> code inspection now has a whole family of quick-fixes to assign call results to variables and generate an <em>if error not nil<\/em> check, or do the same and wrap everything in a closure in case of <em>defer<\/em> and <em>go<\/em> statements.<\/p>\n<h2 id=\"more_quick_fixes\"><strong>More quick-fixes<\/strong><\/h2>\n<ul>\n<li>\nQuick-fix for type incompatibility inside composite literals.\n<\/li>\n<li>\nThe <em>Create Type<\/em> quick-fix now offers to create a type when GoLand notices you are using one that has not yet been defined. GoLand will also create the fields for you.\n<\/li>\n<li>\n<em>Generate getter and setters<\/em> now creates for the whole struct all at once.\n<\/li>\n<\/ul>\n<h2 id=\"refactorings\"><strong>Refactorings<\/strong><\/h2>\n<ul>\n<li>\nThe <em>Extract Type<\/em> refactoring lets you extract a type from an existing one or convert an anonymous structure type to a named type.\n<\/li>\n<li>\nThe <em>Rename<\/em> refactoring is available now in <em>go.mod<\/em> files to allow you to rename the module with a new name safely. There is no need to do a search and replace in the project tree to replace the old module name.\n<\/li>\n<\/ul>\n<h2 id=\"code_with_me\"><strong>Code With Me<\/strong><\/h2>\n<p>Code With Me, a new JetBrains service for collaborative development and pair programming, is now available as a plugin for GoLand.<\/p>\n<p>Set the required level of access to your project and share the link with your guests. Your peers <a href=\"https:\/\/www.jetbrains.com\/help\/idea\/faq-about-code-with-me.html\" target=\"_blank\" rel=\"noopener\">don\u2019t even need <\/a>to have their own IDEs installed to collaborate with you. <a href=\"https:\/\/blog.jetbrains.com\/zh-hans\/blog\/2021\/02\/16\/code-with-me-beta-support-for-audio-and-video-calls\">Embedded audio and video calls<\/a>, along with chat messaging, will help teams discuss code, share their knowledge, and cooperate more efficiently. <\/p>\n<h2 id=\"postfix_completion\"><strong>Postfix Completion<\/strong><\/h2>\n<p>Use the new .<em>varCheckError<\/em> Postfix Completion template after an identifier that returns an error to automatically add default variable names and return the error from the function.<\/p>\n<h2 id=\"formatter\"><strong>Formatter<\/strong><\/h2>\n<p>The built-in formatter can now group imports in the same way <em>goimports -local<\/em> does.<\/p>\n<h2 id=\"run_debug\"><strong>Run &amp; debug <\/strong><\/h2>\n<p>GoLand 2021.1 allows you to run an extended sudo session.<\/p>\n<h2 id=\"code_completion\"><strong>Code completion<\/strong><\/h2>\n<p>In this new version, we have introduced the early stages of code completion based on machine learning (ML), which is an alternative to the standard ranking mechanism.<\/p>\n<h2 id=\"ui_improvements\"><strong>UI improvements<\/strong><\/h2>\n<ul>\n<li>\nQuick access menu to switch themes or keymaps, navigate to plugins, and go to settings has been placed in the top right-hand corner of the IDE.\n<\/li>\n<li>\nQuick access to recent projects on Windows.\n<\/li>\n<li>\nBetter tooltips display.\n<\/li>\n<li>\nFont variations.\n<\/li>\n<\/ul>\n<h2 id=\"other\"><strong>Other <\/strong><\/h2>\n<ul>\n<li>\nBuilt-in HTML preview.\n<\/li>\n<li>\nAn ability to maximize editor tabs in the split view.\n<\/li>\n<li>\n<a href=\"https:\/\/plugins.jetbrains.com\/plugin\/9333-makefile-language\" target=\"_blank\" rel=\"noopener\">Makefile Language plugin<\/a> works by default.\n<\/li>\n<\/ul>\n<p>We love hearing from you! Don\u2019t hesitate to ping us <a href=\"https:\/\/twitter.com\/golandide\" target=\"_blank\" rel=\"noopener\">on Twitter<\/a> or report any issues you find to <a href=\"https:\/\/youtrack.jetbrains.com\/issues\/GO\" target=\"_blank\" rel=\"noopener\">our bug-tracker<\/a>. We would also really appreciate your feedback on the release. Share your thoughts and any comments \u2013 we\u2019d love to discuss them with you!<\/p>\n","protected":false},"author":754,"featured_media":135171,"comment_status":"closed","ping_status":"closed","template":"","categories":[4221,907],"tags":[6412,91],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/go\/134709"}],"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\/754"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=134709"}],"version-history":[{"count":7,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/go\/134709\/revisions"}],"predecessor-version":[{"id":138382,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/go\/134709\/revisions\/138382"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/135171"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=134709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=134709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=134709"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=134709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}