<p>Its been 2+ years since the last environment post that I could find. Any new additions to the Go world that we should consider adding to our everyday workflows? </p>
<p>Im fairly newish to Go, mainly just learning the syntax and what not, but as of right now I just use Atom + a couple of ITerm windows. Curious to see what else is out there.</p>
<hr/>**评论:**<br/><br/>redditbanditking: <pre><p>I use vim, so <a href="https://github.com/fatih/vim-go" rel="nofollow">vim-go</a> is pretty good. It does go fmt automatically every time you save. It has a bunch of other shortcuts for common go commands.</p>
<p>I am still waiting a good Go IDE (looking at you, JetBrains), that can refactor, remove unused imports automatically, insert imports automatically, insert <code>if err != nil</code> templates.</p>
<p>edit: apparently I put the wrong link.</p></pre>inferiormartin: <pre><p>Gogland is pretty good although still in early development. There's also the Go plugin for IDEA</p></pre>comrade-jim: <pre><p>+>
refactor, remove unused imports automatically, insert imports automatically, insert if err != nil templates.</p>
<p>Learn to use Vim and vim-go. They can do all that. </p></pre>borring: <pre><p>Vim-go should be using goimports instead of gofmt. That pretty much takes care of most of what you just said.</p></pre>ChristophBerger: <pre><p>Any editor that uses Go plugins with support for <code>goimports</code>, <code>goreturns</code>, and the like can insert and remove imports automatically. </p>
<p>Visual Studio Code has template inserting capabilities, and I believe the Go extension even comes with an <code>if err != nil</code> template by default.</p>
<p>Refactoring is another story. VSC helps with features like "Find all references" etc, but so far I don't know of an Editor/IDE with full refactoring support (disclaimer: I do not constantly observe the current state of Go IDE's and editor plugins.)</p>
<p>A couple of command-line tools can help with refactoring, see e.g. <a href="http://talks.godoc.org/github.com/rogpeppe/talks/refactoring.talk/refactoring.slide#1" rel="nofollow">here</a>.</p></pre>comrade-jim: <pre><p>FYI, Visual Studio Code doesn't have nearly as many features as vim-go:</p>
<p><a href="https://github.com/microsoft/vscode-go" rel="nofollow">https://github.com/microsoft/vscode-go</a></p>
<p><a href="https://github.com/fatih/vim-go" rel="nofollow">https://github.com/fatih/vim-go</a></p>
<p>In my experience, there is also noticeable lag when working with large Go projects in VSCode, even when turning off the blinking cursor (people keep telling me the cursor uses 13% CPU).</p></pre>ChristophBerger: <pre><p>I would not necessarily agree that the list of vscode-go features is shorter than that of vim-go. The more important question is how many, and which, of these features you actually use for everyday work. </p>
<p>I can only speak for myself, but I switched from Vim to VSC a while ago and I do not miss any particular feature. </p>
<p>Regarding "13% CPU", I just tested this and found that a blinking cursor does not affect CPU load in any way. Maybe this has been true for older versions of VSC.</p></pre>tmornini: <pre><p>Atom on external monitor left side, terminal on right side, chrome on laptop screen.</p>
<p>Boom!</p>
<p>Planning a switch to Linux from MacOS soon.</p></pre>darkmagician2: <pre><p>Atom in 2017? Ouch.... Move to VS Code plz :)</p></pre>WeeniePistols: <pre><p>I like Atom a lot actually. Its just simple, VS Code is quite nice as well i guess it was just which I used first.</p></pre>disq: <pre><ul>
<li>Gogland + its built-in terminal window bound to F13 key (full-size mac keyboard)</li>
<li>Lots of middle-clicking on symbols, reading godoc comments and code in external (or standard) library sources that way.</li>
</ul></pre>andradei: <pre><p>Built-in terminal is a great feature. VSCode also has it.</p></pre>WeeniePistols: <pre><p>yeah I installed the Atom terminal plugin, built in terminal but seem to always default back to two monitors and iTerm on one and Atom on the other.</p></pre>GoTheFuckToBed: <pre><ol>
<li>install go</li>
<li>Visual Studio Code</li>
<li>install the go extension (it will install the extra tools)</li>
</ol>
<p>done, it uses the default path</p></pre>justinisrael: <pre><p>I only ever set $GOPATH and $GOBIN, unless I have done a custom installation of go from source, in which case I would also set $GOROOT (but less common).</p>
<p>But none of this has changed for me since go 1.0</p>
<p><em>Edit</em> : And I only set a single path on $GOPATH</p></pre>justinisrael: <pre><p>I just realized you are also asking about editors and workflows. You are going to hear a large mixture of editors. I still use SublimeText3, and have been recently using AnacondaGO plugin. I don't use build system configurations from my editor. I prefer to just have the side-car terminal window.</p></pre>WeeniePistols: <pre><p>haha yeah, i figured you probably glazed over the question at first look. Thanks for the updated answer!</p></pre>comrade-jim: <pre><p>I use vim and vim-go because it's the most feature complete editor/plugin. Using it inside tmux I can use delve, but no one at the company I work for uses a debugger.</p>
<p>I've tried sublime, atom, and Visual Studio code and none of them even come close.</p></pre>driusan: <pre><p>I use a text editor that I wrote and a shell or two. (About half the time sh on DragonFlyBSD and half the time rc on 9front.) </p>
<p>I suspect I'm in the minority.</p></pre>joeyGibson: <pre><p>I use Gogland, though I hope to switch back to IntelliJ + the Go plugin, once it is at parity with Gogland. The main thing that is keeping me from using IntelliJ right now is the lack of the ability to run <code>gofmt</code> on file save, like Gogland provides.</p></pre>WeeniePistols: <pre><p>oh I just googled Gogland and its the new in work JetBrains IDE. Yeah, im pretty pumped for that, but ill probably wait until they work out most of the bugs.</p></pre>joeyGibson: <pre><p>I use it daily at work, and I've found it to be rock solid. </p></pre>de_joerg: <pre><p>Also using Gogland on Mac, its pretty solid.</p></pre>WeeniePistols: <pre><p>Thats great to hear, Im all about the JetBrains suite of IDE's.</p></pre>vi-to-emacs-evil168: <pre><p>I had read that the dev for gogland was then intellij plugin dev too and he no longer planned to maintain the plugin. Hope I'm wrong here.</p></pre>joeyGibson: <pre><p>I read somewhere that they will eventually get the plugin to parity with Gogland, but it's not s priority right now. I hope they do, because we use Cucumber and Ruby for testing, and it would be nice to do all my editing in IntelliJ. </p></pre>Kraigius: <pre><p>Gogland is the shit, I highly recommend it.
Auto goftm on save, code completion, detection of errors, type information when hovering on variables...everything expected of a fully fledged IDE. I encountered some bugs when debugging (ie: either not stopping on breakpoints or not loading the variables in the inspector) but other than that nothing.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传