Code review wanted! github.com/narqo/go-badge - A small library for rendering shield badges to SVG

xuanbao · · 478 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<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&#39;ve leaned from my programming experiense is that reading and understanding other&#39;s (good) code is not the same as writing your own (good) code.</em> :)</p> <p>As a small study project I&#39;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 &#34;do-one-thing library&#34;, so there is no build-in http api server, that renders shields online, or any cli tools.</p> <p>As I said I&#39;m on my way learning Go, so if anyone has some free time to look at the code and give me some advice I&#39;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 &#34;googling/stackoverflowing&#34; 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>

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

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