<p>Hi Everyone. I've been trying out Go for small projects for a month now, but when looking at my code I'm under the impression that I'm not using efficient patterns and making the most out of what Go gives (forgetting to use pointers, scarcely using anonymous functions). </p>
<p>I'm looking for an inspiration based on well-known Go projects which are not as huge and complex as e.g. moby and perhaps not as low-level as the ones in standard lib. If they are well documented that would be a plus. Resources like blogs where someone way smarter than me goes from 0 to something more than main package script would be awesome too. If you have a project like that I'd love to see it too!</p>
<hr/>**评论:**<br/><br/>leaf_bebop: <pre><p>Standard libraries.</p></pre>shovelpost: <pre><blockquote>
<p>but when looking at my code I'm under the impression that I'm not using efficient patterns and making the most out of what Go gives (forgetting to use pointers, scarcely using anonymous functions).</p>
</blockquote>
<ul>
<li><p>Read <a href="https://golang.org/doc/effective_go.html" rel="nofollow">Effective Go</a> many times.</p></li>
<li><p>Read <a href="https://github.com/golang/go/wiki/CodeReviewComments" rel="nofollow">CodeReviewComments</a>.</p></li>
<li><p>Use tools like <code>golint</code>, <code>go vet</code> and <a href="https://github.com/alecthomas/gometalinter" rel="nofollow">gometalinter</a>.</p></li>
<li><p>Post specific examples of things you are not sure about so we can help.</p></li>
<li><p>Don't worry and just keep coding. </p></li>
</ul></pre>hell_0n_wheel: <pre><blockquote>
<p>Don't worry and just keep coding.</p>
</blockquote>
<p>This. Premature optimization is never a good thing. If your code works correctly and runs without unreasonable delay, who cares what it looks like under the hood? Tons and tons of ugly code out there making $$$$$$$$$.</p></pre>zacgarby: <pre><p>Most of the standard libraries aren't that low level.</p></pre>qu33ksilver: <pre><blockquote>
<p>forgetting to use pointers</p>
</blockquote>
<p>A lot of people that using pointers makes your program "cool" and you feel like a real "software engineer".</p>
<p>In practice, pointers do not give the best performance always. Run <code>gcflags="-m -m"</code> and see for yourself. Sometimes, it is better to put things on stack. The stack is fast and cache-friendly. As always YMMV.</p></pre>pom_bear: <pre><p>Not sure if this is exactly what you're asking for but check out gophercises.com </p></pre>s-kostyaev: <pre><p><a href="https://github.com/cweill/gotests" rel="nofollow">https://github.com/cweill/gotests</a> for example.</p></pre>peterbourgon: <pre><p>I think <a href="https://github.com/oklog/oklog" rel="nofollow">https://github.com/oklog/oklog</a> is quite well-done and easy to read, but I’m definitely biased.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传