{"id":33440,"date":"2020-03-10T17:11:26","date_gmt":"2020-03-10T17:11:26","guid":{"rendered":"https:\/\/blog.jetbrains.com\/go\/?p=2127"},"modified":"2020-03-11T11:02:10","modified_gmt":"2020-03-11T11:02:10","slug":"goland-2020-1-eap-4","status":"publish","type":"go","link":"https:\/\/blog.jetbrains.com\/zh-hans\/go\/2020\/03\/10\/goland-2020-1-eap-4","title":{"rendered":"GoLand 2020.1 EAP 4: Support for Environment Variables, and You Can Use GoLand as a Simple Text Editor"},"content":{"rendered":"<p>You can get this EAP build through the <a href=\"https:\/\/www.jetbrains.com\/toolbox\/app\/\" target=\"_blank\" rel=\"noopener\">Toolbox App<\/a>, by downloading it from the <a href=\"https:\/\/www.jetbrains.com\/go\/nextversion\/\" target=\"_blank\" rel=\"noopener\">website<\/a>, by using a snap package (for Ubuntu), or from right inside GoLand by selecting <em>Automatically check updates<\/em> for Early Access Program in <em>Preferences \/ Settings | Appearance &amp; Behavior | System Settings | Updates<\/em>.<\/p>\n<p>Don\u2019t forget that we regularly release nightly builds based on the latest development code. You can use these nightly builds to get access to the latest features without having to wait for the official EAP announcements. These nightly builds are only available via the <a href=\"https:\/\/www.jetbrains.com\/toolbox\/app\/\" target=\"_blank\" rel=\"noopener\">Toolbox App<\/a>, however.<\/p>\n<p align=\"center\"><a class=\"jb-download-button\" href=\"https:\/\/www.jetbrains.com\/go\/nextversion\/\" target=\"_blank\" rel=\"noopener\"><i class=\"download-icon\"><\/i>Download GoLand 2020.1 EAP #4<\/a><\/p>\n<h2 id=\"go_modules\"><strong>Go Modules <\/strong><\/h2>\n<p>Go 1.13\u2019s environment variables <code>GOPROXY<\/code>, <code>GOPRIVATE<\/code>, <code>GOSUMDB<\/code>, <code>GONOPROXY<\/code>, and <code>GONOSUMB<\/code> are now supported.<\/p>\n<p>On the <em>Go Modules<\/em> projects template, you can easily configure the defaults for the values of all the environment variables in one place, get a short description for each one, and navigate to the <a href=\"https:\/\/golang.org\" target=\"_blank\" rel=\"noopener\">https:\/\/golang.org<\/a> source to get more information about them. Simply click the <em>Browse<\/em> icon in the Environment field to open the new <em>Environment Variables<\/em> dialog.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2132\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2020\/03\/go-go-modules-environment-variables.gif\" alt=\"go-modules-environment-variables\" width=\"750\" height=\"300\" \/><br \/>\n<!--more--><\/p>\n<h2 id=\"quick_fixes\"><strong>Quick-fixes<\/strong><\/h2>\n<p>The<em> Create variable<\/em> quick-fix now shows an expected type hint, making it easier for you to enter the right value. In addition to this, it automatically provides the <em>Initialize with zero value<\/em> completion item, which creates a full variable declaration with the expected type, instead of a short declaration.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2128\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2020\/03\/go-create-variable.gif\" alt=\"create-variable\" width=\"750\" height=\"300\" \/><\/p>\n<h2 id=\"code_inspections\"><strong>Code Inspections <\/strong><\/h2>\n<p>The code inspection<em> Invalid conversions of uintptr to unsafe.Pointer <\/em>warns you about incorrect uses of uintptr to unsafe.Pointer to convert integers to pointers.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2129\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2020\/03\/go-invalid-conversions.png\" alt=\"invalid-conversions\" width=\"750\" height=\"300\" \/><\/p>\n<p>The code inspection <em>Unmarshal is called with incorrect argument <\/em>analyzes calls to <code>json.Unmarshal<\/code> and similar functions of <code>encoding\/json<\/code>, <code>encoding\/xml<\/code> and <code>encoding\/gob<\/code> packages.<\/p>\n<p>It reports a problem if the argument that is passed to store the result is not a pointer or an interface. Such calls are guaranteed to fail and return an error.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2130\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2020\/03\/go-unmarshal.png\" alt=\"unmarshal\" width=\"750\" height=\"300\" \/><\/p>\n<h2 id=\"refactorings\"><strong>Refactorings<\/strong><\/h2>\n<h3 id=\"in_place_rename\"><strong>In-place Rename<\/strong><\/h3>\n<p>GoLand 2020.1 will provide a simpler way to perform the <em>Rename<\/em> refactoring.<\/p>\n<p>You no longer need to deal with a modal dialog to change the name of any declaration. Simply edit the name of a method or function, and then use the new gutter icon or an intention action (<em>Alt+Enter<\/em>) to review. The IDE will show a gutter icon that will offer to rename all its usages.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2131\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2020\/03\/go-in-place-rename.gif\" alt=\"in-place-rename\" width=\"750\" height=\"300\" \/><\/p>\n<h3 id=\"extract_method\"><strong>Extract Method<\/strong><\/h3>\n<p>Now when you extract a method or a function using the <em>Extract Method<\/em> refactoring, it keeps the original order of the parent function\/method parameters.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2133\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2020\/03\/go-exctract-method.gif\" alt=\"exctract-method\" width=\"750\" height=\"300\" \/><\/p>\n<h2 id=\"using_goland_as_a_simple_text_editor\"><strong>Using <\/strong><strong>GoLand<\/strong><strong> as a simple text editor<\/strong><\/h2>\n<p>With the new <em>LightEdit<\/em><em> Mode<\/em>, you can open a file in the text editor window without creating or loading a project.<\/p>\n<p>To try this new functionality out, you will first need to create a command-line launcher from <em>Tools | Create Command-line Launcher<\/em> as described <a href=\"https:\/\/www.jetbrains.com\/help\/idea\/working-with-the-ide-features-from-command-line.html\" target=\"_blank\" rel=\"noopener\">here<\/a>. If you\u2019re using the Toolbox App, the steps will be <a href=\"https:\/\/www.jetbrains.com\/help\/idea\/working-with-the-ide-features-from-command-line.html#toolbox\" target=\"_blank\" rel=\"noopener\">slightly different<\/a>.<\/p>\n<p>For more detailed instructions on how to open a file, compare\/merge files, and even run code inspections, see <a href=\"https:\/\/www.jetbrains.com\/help\/idea\/opening-files-from-command-line.html\" target=\"_blank\" rel=\"noopener\">this<\/a> web help section.<\/p>\n<p>If GoLand has already been launched, the file will be opened in it. If GoLand is not yet running, the file will be opened in <em>LightEdit Mode<\/em> instead.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2134\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2020\/03\/go-LightEdit-Mode.png\" alt=\"LightEdit-Mode\" width=\"750\" height=\"300\" \/><\/p>\n<h3 id=\"other\"><strong>Other <\/strong><\/h3>\n<p>GoLand 2020.1 will run `go list` to get dependencies less often. For Go 1.14, it uses a temporary copy of the go.mod file to avoid undesired changes in it.<\/p>\n","protected":false},"author":754,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","categories":[826,808],"tags":[782,3911,3919,91,3912,659],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/go\/33440"}],"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=33440"}],"version-history":[{"count":0,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/go\/33440\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=33440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=33440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=33440"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=33440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}