<p><em>What I found most frustrating during my slow way to Go language is the lack of any sort of code review. And what I've leaned from my programming experiense is that reading and understanding other's (good) code is not the same as writing your own (good) code.</em> :)</p>
<p>As a small study project I've written this tiny but, hope, fun library: <a href="https://github.com/narqo/go-badge" rel="nofollow">github.com/narqo/go-badge</a> - A small library for rendering shield badges to SVG. Most of the ideas were took from the brilliant shield.io project written in Node.js.</p>
<p><a href="https://github.com/narqo/go-badge" rel="nofollow">go-badge</a> tends to be a "do-one-thing library", so there is no build-in http api server, that renders shields online, or any cli tools.</p>
<p>As I said I'm on my way learning Go, so if anyone has some free time to look at the code and give me some advice I'd be very pleased.</p>
<hr/>**评论:**<br/><br/>dlsniper: <pre><p>Sent, hope it helps :) Congrats on the library, keep it Going :)</p></pre>gohacker: <pre><p>What is this 64? <a href="https://github.com/narqo/go-badge/blob/1650d0cdc85951e530d6d9d96dfbd9bd735235f7/badge/badge.go#L48" rel="nofollow">https://github.com/narqo/go-badge/blob/1650d0cdc85951e530d6d9d96dfbd9bd735235f7/badge/badge.go#L48</a></p></pre>varankinv: <pre><p>Yeah! This looks weird for me as well. This magic has came from my "googling/stackoverflowing" about how to convert <code>fixed.Int26_6</code> results of the <a href="https://godoc.org/golang.org/x/image/font#Drawer.MeasureString" rel="nofollow">Drawer.MeasureString</a> to float64 pixels.</p></pre>
Code review wanted! github.com/narqo/go-badge - A small library for rendering shield badges to SVG
xuanbao · · 492 次点击这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传