My first go program. I would like to get code review.

blov · · 404 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hello. I am c# developer, but I started to learn go. I wrote a small program in go that is http mock server. I would like to receive some pointers on implementation, code style and go naming guidelines. </p> <p>Application is designed to provide responses based on url, headers and query params. I tried to make configuration as easy as possible, hence I used yaml for configuration file, as it allows to put json and xml bodies without escaping them. Also responses are selected by url and first select clause that matches (no select will match everything)</p> <p>Github: <a href="https://github.com/ArtyomTurkin/go-MockHttp" rel="nofollow">https://github.com/ArtyomTurkin/go-MockHttp</a> </p> <p>Thank you. </p> <hr/>**评论:**<br/><br/>epiris: <pre><p>Read <a href="https://blog.golang.org/package-names" rel="nofollow">package</a> and then write <a href="https://golang.org/pkg/testing/" rel="nofollow">tests</a> including a <a href="https://blog.golang.org/examples" rel="nofollow">testable example</a> or two. The Go tooling will guide you towards the side of correctness as long as you use it. Specifically be diligent with golint and goimports to make life a little easier. I say this because early on while writing simple programs like this you will get more out of tooling and practice than line items from experienced engineers. The interesting questions will start popping up as you get farther along. Glad to see your giving Go a try, happy coding.</p></pre>

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

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