Machine Setup Guide

polaris · · 858 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m working on a new machine setup guide for Go here: <a href="http://www.golang-book.com/guides/machine_setup">http://www.golang-book.com/guides/machine_setup</a>. The goal here is to get a machine configured to use Go, but make very few assumptions about what a user already knows. (I had previously &#34;solved&#34; this by providing installers... but it didn&#39;t take long for them to become obsolete)</p> <p>I&#39;m going to add a few images for the Windows part, but was wondering if anyone had any thoughts / suggestions.</p> <hr/>**评论:**<br/><br/>Gambletron: <pre><p>Something simple that gets a lot of mileage is to put tabs for each OS, instead of having them list one after another</p></pre>jbuberel: <pre><p>I know, not directly applicable, but have you considered creating a set of Vagrant boxes (using VirtualBox as the provider) for a downloadable &#34;Fully configured Go starter experience&#34;?</p> <p>Just a thought.</p> <p><a href="http://docs.vagrantup.com/v2/virtualbox/index.html" rel="nofollow">http://docs.vagrantup.com/v2/virtualbox/index.html</a></p></pre>calebdoxsey: <pre><p>That&#39;s an interesting idea. They&#39;d still need a text editor, git, etc... but I suppose not having to fiddle with environment variables would be easier. It&#39;s kind of amazing just how hard it is to do this... Windows has this ancient, buried UI for it, there isn&#39;t even a reliable way to do it per-user in OSX, and all the other Unixes can&#39;t agree on where to put them. I&#39;d just skip the whole thing, but unfortunately go really does need a GOPATH set. (and really you need the bin folder added to your PATH)</p> <p>Maybe I&#39;ll see how hard it is to do a from-scratch install with the vm route.</p> <p>One option that is pretty straightforward is a cloud box like nitrous.io, which wouldn&#39;t require any installation at all. Unfortunately you&#39;re left with a fairly clumsy editor, but maybe it&#39;s good enough.</p></pre>qu33ksilver: <pre><p>Then using a docker container is a better idea.</p></pre>calebdoxsey: <pre><p>Docker only works in linux.</p></pre>qu33ksilver: <pre><p><a href="https://docs.docker.com/installation/windows/" rel="nofollow">https://docs.docker.com/installation/windows/</a></p></pre>calebdoxsey: <pre><p>It runs linux in a virtual machine. This is just like vagrant except it doesn&#39;t come with the features you&#39;d need to do local development. See this for example: <a href="https://github.com/boot2docker/boot2docker#folder-sharing" rel="nofollow">https://github.com/boot2docker/boot2docker#folder-sharing</a>. Teaching a user how to setup samba is harder than all the other steps combined.</p> <p>Maybe when Microsoft finishes their own docker implementation it will make more sense. (Because then you could run a windows container with go installed)</p></pre>klaaax: <pre><p>liteide is a way better IDE to get started with Go. And it is fast, unlike Atom/</p> <p>And you forgot about ming on windows, obviously you need a C compiler and standard C headers to compile most cgo code.</p></pre>calebdoxsey: <pre><p>Last time I tried liteide it was pretty buggy... I personally use Atom, as it&#39;s very much like sublime. I&#39;ve not found it to be slow, but I&#39;ll take another look at liteide (does liteide work with other languages like javascript/html/css?)</p> <p>cgo on windows is unfortunately really hard. In my experience cgo packages almost never work out of the box since very few people bother to test windows. (so their cgo headers are all wrong) That and c is just, in general, difficult in windows since most development is actually done with visual studio instead of gcc. So all the unix tools are half-broken. (do you use the 32 bit compiler or the 64 bit one? regular cmd window or a mingw shell? cygwin?, etc...)</p> <p>Maybe I&#39;ll make a separate guide for that.</p></pre>dchapes: <pre><p>Why mention an IDE at all? Just say &#34;your favourite editor&#34; (or perhaps list some fancier <em>optional</em> ones).</p> <p>The few times I had to use an IDE I hated it with a passion; I think the whole idea of not using the same single powerful editor for (just about) everything is flawed.</p></pre>calebdoxsey: <pre><p>When you try to teach someone how to use Go (or really any language) you immediately run into this massive knowledge barrier. Regular people have never used a terminal or a text editor. You&#39;ll be lucky if they even have a firm grasp of files and folders.</p> <p>If a user already knows about vim (for example), then they probably don&#39;t need my help in learning how to configure the rest of their machine. The existing go documentation is more than adequate.</p> <p>But if they&#39;ve never used a text editor, they don&#39;t even know that they need one. The entire programming compilation lifecycle is brand new to them.</p> <p>That&#39;s why the original book started the way it did: <a href="http://www.golang-book.com/books/intro/1" rel="nofollow">http://www.golang-book.com/books/intro/1</a>. My hope was to alter the text here and link to the setup guide, but maybe I should revisit the installer.</p></pre>joefitzgerald: <pre><p>Caleb, go-plus author here. Please let me know if you have ideas about further simplifying a user&#39;s first experience with go and Atom. I have specifically tried to make the experience as easy as possible for a newbie gopher, and I want to continue to streamline that experience.</p></pre>calebdoxsey: <pre><p>Hi Joe, I think the plugin is fantastic. It&#39;s very easy to get installed and almost everything just works out of the box. It even catches common mistakes (like not having a GOPATH set, or not having git installed) and gives you a sensible error message.</p> <p>That&#39;s why I thought it would be the best option for a new person.</p> <p>The upside to an IDE like Intellij or Visual Studio is that they do a lot to get a user started. You can develop applications in Visual Studio and never touch the command line, so that would be one less thing to learn.</p> <p>But I think even with an IDE, you would still use the command line a lot with go. It&#39;s just how the whole tool ecosystem is designed - so I&#39;d be doing users a disservice by not covering it. I think Atom + your plugin does a nice job of making that as easy as possible without compromising the basic workflow. </p> <p>And unlike sublime it&#39;s a free editor that&#39;s actively maintained.</p> <p>The only issue I ran into with the plugin was that apparently <code>autocomplete-plus</code> comes with the windows version but has to be installed in the mac version. I&#39;m wondering if maybe this is just a version issue - where maybe the windows version was slightly more up to date. Anyway thanks for all the work you put into the plugin.</p></pre>joefitzgerald: <pre><p>This must be a version issue. autocomplete-plus was a separate package but now comes bundled (as of 0.200.0) with Atom. You should not have to separately install it on OSX or Linux.</p> <p>Oddly, this is only the case because I wanted atom to have a great gocode integration, and the built in autocomplete couldn&#39;t deliver a great integration. So @park9140 and I rewrote autocomplete-plus and managed to get it accepted by the core Atom team to replace the old autocomplete package.</p> <p>See also: <a href="http://blog.atom.io/2015/05/15/new-autocomplete.html" rel="nofollow">http://blog.atom.io/2015/05/15/new-autocomplete.html</a></p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

858 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传