<p>The latest release mentioned this feature. Is it removing unused import on saving the file?</p>
<blockquote>
<p>Last but not least, the Auto Import has been made smarter and prevents you from adding undesired import statements (GO-5118).</p>
</blockquote>
<p><a href="https://blog.jetbrains.com/go/2018/02/15/goland-2018-1-eap-3-move-refactoring-better-test-runner-go-build-quickdoc-and-more/" rel="nofollow">https://blog.jetbrains.com/go/2018/02/15/goland-2018-1-eap-3-move-refactoring-better-test-runner-go-build-quickdoc-and-more/</a></p>
<hr/>**评论:**<br/><br/>dlsniper: <pre><blockquote>
<p>The latest release mentioned this feature. Is it removing unused import on saving the file?</p>
</blockquote>
<p>No, this is removing the import as soon as it's not used in the file anymore, without saving the file, it's what I've mentioned here: <a href="https://www.reddit.com/r/golang/comments/82ilek/does_goland_support_automatically_remove_unused/dvace3n/" rel="nofollow">https://www.reddit.com/r/golang/comments/82ilek/does_goland_support_automatically_remove_unused/dvace3n/</a></p></pre>marksteve4: <pre><p>I downloaded the latest version. But this doesn't seem to work. Do I need to have some setup? all my import options are checked.</p></pre>dlsniper: <pre><p>I think it's better if you open an issue on <a href="https://youtrack.jetbrains.com/issues/Go" rel="nofollow">https://youtrack.jetbrains.com/issues/Go</a> as I'm not sure if this is the best place to get help for this. My initial thought would be to ask you for a screenshot of <code>Settings | Go | Imports</code>.</p></pre>jackie_pwn_asses: <pre><p>I believe that it is idiomatic go to manually delete the import with the backspace key. It's important to be aware of the changes you're making to your code. How would you feel if the IDE automatically <em>added</em> imports to your program? </p>
<p>As a programmer you should be aware that you've removed a dependency. </p></pre>Justinsaccount: <pre><blockquote>
<p>How would you feel if the IDE automatically added imports to your program?</p>
</blockquote>
<p>vim-go does this with goimports and I feel great about it.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传