Advices for beginners in golang

blov · · 946 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>GoDocs, GoTour are finished. What are some advices you could give to beginners who learned the basic stuff and started using go. </p> <p>Note: I&#39;m not looking for how to write go or go examples. I&#39;m looking for maybe small tricks in writing code, general frameworks which are awesome, tools, IDE&#39;s...</p> <hr/>**评论:**<br/><br/>dulerock: <pre><p>I believe that best way to learn something is to make something. For instance, I took a pdf server generator which we use in our company (written in NodeJs) and started rewriting it in Go. I used Martini framework for http api and gofpdf for creating pdfs. Beside that, I started doing a bunch of algorithm tasks on hackerrank.com in Go. </p></pre>q1t: <pre><p>There are not many (web?) frameworks, just one - net/http :) and plenty of packages that helps with middleware and multiplexing (<a href="https://github.com/justinas/alice" rel="nofollow">https://github.com/justinas/alice</a>, <a href="http://www.gorillatoolkit.org/" rel="nofollow">http://www.gorillatoolkit.org/</a>) I&#39;m not sure what do you mean by macros since Go does not support them.</p></pre>QThellimist: <pre><p>GoSublime macro&#39;s are pretty cool. I found this which is pretty neat. <a href="https://gist.github.com/cihangir/4e8944c0838decf17476" rel="nofollow">https://gist.github.com/cihangir/4e8944c0838decf17476</a></p></pre>Ainar-G: <pre><p>I&#39;d suggest starting with the <a href="http://golang.org/doc/#learning" rel="nofollow">Official docs</a> and especially <a href="http://golang.org/doc/effective_go.html" rel="nofollow">Effective Go</a>. Then, go on and try implementing something with the <a href="http://golang.org/pkg/" rel="nofollow">standard library</a>.</p></pre>drvd: <pre><p>Are you looking for advice to a &#34;veteran in C, C++, Java and FORTRAN but beginner in Go&#34; or advice to &#34;beginner in programming, Go focused&#34;?</p> <p>And please don&#39;t do frameworks.</p></pre>QThellimist: <pre><p>veteran in other languages. I&#39;m looking for stuff which which makes the experience better. GoSublime, GoVim, GoLint are some examples which makes it better.</p></pre>nindalf: <pre><p>For the editor I would suggest using Sublime Text with the GoSublime plugin. Here are the <a href="http://blog.campoy.cat/2013/12/integrating-goimports-with-gosublime-on.html" rel="nofollow">installation instructions</a>. As far as I know, the vast majority of Go programmers use text editors like Sublime, vim or emacs rather than IDEs. You can still check out Intellij IDEA with the Go plugin if you really want an IDE.</p> <p>I second the suggestion by someone else in the thread that you should start with a project (though not with his endorsement of Martini). That&#39;s the best way to learn, I feel. One project that I recently did was a link shortener using redis. I used only the standard library and a <a href="https://github.com/garyburd/redigo" rel="nofollow">redis library</a>. It was short, fun and useful. If you decide to try this out, we can compare implementations later :)</p></pre>jasonrichardsmith: <pre><p>My advice. Whenever needing to Marshall anything, structures are your friend. Especially with bson and json. Bu I am still a noob.</p></pre>QThellimist: <pre><p>could you give an example</p></pre>Momer: <pre><p><a href="https://gobyexample.com/json" rel="nofollow">https://gobyexample.com/json</a></p></pre>

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

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