<p>I just decided that i will do our next project in Go, since i heard great things about it. I am switching from Node/Io.js to Go so has anyone from you guys switched from node to go and how was it especialy what you guys recommend to look at when starting web dev with go?</p>
<hr/>**评论:**<br/><br/>sedmonster: <pre><p>What are you looking to build?</p>
<p>As with any project, there are different platforms/languages/tools that are better or more poorly suited for the task at hand. IMO, I don't think "hearing great things" is a good reason to switch platforms, unless you know the substance of what it is great at and how that fits into your goals.</p>
<p>More constructively, for instance if you're building out large, complex REST APIs and you think that building it out in Go will be faster and easier than in Rails::API, you will probably not find that to be the case. On the other hand, if speed/performance/executable size matters, Go is definitely quite good at that. And that's just high level -- nevermind the database bindings you will need to integrate, user auth, etc.</p></pre>fr4nk3n: <pre><p><a href="https://github.com/astaxie/build-web-application-with-golang/blob/master/en/preface.md" rel="nofollow">Here</a> are quite a few tutorials (written by astaxie), I would go through them all if I was starting with web development with Go (I haven't used node though). What will the project be?</p></pre>jan1024188: <pre><p>If you want to build an api, look into <code>go-restful</code>.</p></pre>space-llama: <pre><p>I'd mostly suggest sticking to the standard library until you find some pain point that a small library solves. A lot of web framework libs for Go end up either recreating the standard lib's net/http package, or offer a gimmick in exchange for restricting transparency.</p>
<p>web dev in Go is very boring since there's usually one or two ways to sanely write/layout the packages and so there's not a lot of creative thought that needs to happen, just a lot of typing. I do this every day.</p></pre>pusic007: <pre><p>I was big node.js fan, but then I decided to try Go. It is much easier to work with go code than with javascript when it comes to refactoring and testing. IMHO GoSublime and vim-go are quite good in comparison with available alternatives for node.js. Currently I am working on e-commerce project, and of course I am building it with Go. There are many web frameworks out there, but I am using Neo <a href="https://github.com/ivpusic/neo" rel="nofollow">https://github.com/ivpusic/neo</a>. Most probably you will need ORM, and I can recommend you <a href="https://github.com/jinzhu/gorm" rel="nofollow">https://github.com/jinzhu/gorm</a>. For testing there is one awesome thing called <a href="http://goconvey.co/" rel="nofollow">http://goconvey.co/</a>. If you want integration testing you can check <a href="https://github.com/ivpusic/httpcheck" rel="nofollow">https://github.com/ivpusic/httpcheck</a>. There are also many small libraries for your specific situations. So far I always find good library for my specific situations. There are some things which I don't like in Go, but this is the case for every language. Go is for me currently best fit (for my current project).</p></pre>ZenSwordArts: <pre><p>Others already mentioned Astaxie's guide, which really is a good read. You will often hear to use Go's std lib and maybe use Gorilla in addition.. and not to use existing frameworks. I disagree with this point. You will have to reinvent the wheel more often than not. </p>
<p>After having used <a href="http://beego.me/" rel="nofollow">Beego</a>(also made by Astaxie) for several projects, I have to conclude that it is a really good framework. The documentation can tricky at times but the code is really clean so you can look it up if the docs fail. In my opinion Beego is the most complete framework for Go. </p></pre>Zilog8: <pre><p>I'd like to tack on to this question. I'm fairly familiar with basic coding in Go (I've solved 120 <a href="https://projecteuler.net/" rel="nofollow">Project Euler</a> problems. Without googling the answer :-) ), but I know zero about web development beyond:</p>
<pre><code> <html><body>Hello World!</body></html>
</code></pre>
<p>Any recommended guides, etc.?</p></pre>jbuberel: <pre><p>As noted by others, <a href="https://github.com/astaxie/build-web-application-with-golang/blob/master/en/preface.md">Build Web Applications with Go</a> is a great starting point.</p></pre>diegobernardes: <pre><p>thx! very nice link</p></pre>ApatheticGodzilla: <pre><p>Depends. If your app has a lot of repetitive CRUD I'm not sure Go is the best choice - I built a project with Django Rest Framework and Angular last year and adding all the bits and pieces - routing, models, permissions etc was quite painless. Doing all that in Go would be doable, but kind of pointless.</p>
<p>On the other hand if I were building something small and fast, perhaps using websockets - a game or chat app, say - the kind of thing I'd probably do with node - then I'd definitely use Go. I find the whole callback/promises mess of Node.js a huge PITA beyond anything trivial.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传