Golang implementation of fixer.io (Ruby) - foreign exchange rates and currency conversion API.

blov · · 417 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hey Gophers!</p> <p>I&#39;m Python developer (mainly web dev) but recently started playing with Golang and I love it! I decided to learn Go and the best way to do this for me is by creating something in it.</p> <p>So, I reimplemented <a href="http://fixer.io" rel="nofollow">fixer.io</a> API that has been written in Ruby by <a href="https://github.com/hakanensari" rel="nofollow">hakanensari</a>. Could you review my code and give any tips or opinions please? I plan to improve it over time but that&#39;s the first version, which I think I can share with others.</p> <p>Code at github: <a href="https://github.com/Luqqk/goexrates#-goexrates" rel="nofollow">goexrates</a></p> <hr/>**评论:**<br/><br/>icholy: <pre><p>Return errors, don&#39;t panic.</p></pre>seblw: <pre><p>You shouldn&#39;t use float for currencies. <a href="https://www.noelherrick.com/blog/always-use-decimal-for-money" rel="nofollow">https://www.noelherrick.com/blog/always-use-decimal-for-money</a></p></pre>UniverseCity: <pre><p>Use net/http status constants, rather than hardcoding 400/500/etc.</p></pre>luqku: <pre><p>Thanks for feedback. Do you have any thoughts about project structure? I know, it&#39;s pretty simple API but I would like to know if there is any convention how to organize this kind of projects.</p></pre>

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

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