<p>So, there are a couple of these around but had some extra time on my hands so I wrote my own to learn more about go (Im coming from a python-background and haven't had lots of experience with go). You can check it out here: <a href="https://github.com/gummiboll/forgetful">forgetful</a> and any suggestions are greatly appreciated!</p>
<hr/>**评论:**<br/><br/>zettahash: <pre><ol>
<li><p>Consider using named functions for defining your commands. It'll clean up your <code>main</code> and let you write tests for your commands. Structs like <code>cli.Command</code> have fields like <code>func(*Context)</code> but they don't always have to be anonymous. This applies to web apps as well when using <code>net/http</code>.</p></li>
<li><p>Your readme mentions being able to clean up old cheatsheets which text files otherwise can't solve. Are you certain sqlite is the ideal solution?</p></li>
<li><p>Even though you don't have any tests, thank you for linting your code on Travis CI.</p></li>
<li><p><code>forgetful</code> is a little long compared to <code>cheat</code>. :P</p></li>
</ol></pre>gummiboll: <pre><blockquote>
<p>Consider using named functions for defining your commands. It'll clean up your main and let you write tests for your commands. Structs like cli.Command have fields like func(*Context) but they don't always have to be anonymous. This applies to web apps as well when using net/http.</p>
</blockquote>
<p>Thanks for pointing this out! main.go has gotten way to messy! I'll do this asap!</p>
<blockquote>
<p>Your readme mentions being able to clean up old cheatsheets which text files otherwise can't solve. Are you certain sqlite is the ideal solution?</p>
</blockquote>
<p>This could easily been done with like json files (and could also been done with regular textfiles to by checking when they where created), the main reason for using sqllite was actually that I wanted to play around with orm's in golang. :)</p>
<p>That said, do you have any specific solution in mind?</p>
<blockquote>
<p>Even though you don't have any tests, thank you for linting your code on Travis CI.</p>
</blockquote>
<p>No tests.. yet :D</p>
<blockquote>
<p>forgetful is a little long compared to cheat. :P</p>
</blockquote>
<p>Hehe, yeah. True :D</p>
<p>Thank you for your input!</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传