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: forgetful and any suggestions are greatly appreciated!
评论:
zettahash:
gummiboll:
Consider using named functions for defining your commands. It'll clean up your
main
and let you write tests for your commands. Structs likecli.Command
have fields likefunc(*Context)
but they don't always have to be anonymous. This applies to web apps as well when usingnet/http
.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?
Even though you don't have any tests, thank you for linting your code on Travis CI.
forgetful
is a little long compared tocheat
. :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.
Thanks for pointing this out! main.go has gotten way to messy! I'll do this asap!
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?
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. :)
That said, do you have any specific solution in mind?
Even though you don't have any tests, thank you for linting your code on Travis CI.
No tests.. yet :D
forgetful is a little long compared to cheat. :P
Hehe, yeah. True :D
Thank you for your input!
