Closed JoshCheek closed 8 years ago
:+1:
Awesome @JoshCheek ! Thanks. Did you test to make sure the other custom commands still function (most importantly :import
)?
I didn't, I only relied on the type system and ran the printing code by hand. It's probably worth checking at least one of them out, just in case, it does something wonky. Based on the name "import", that's a good one to check, b/c if it behaves like the C preprocessor, it literally dumps the contents of some file into the source code (IDK if it's a Golang thing, or if it's part of your lib, or how it works, but depending on all that stuff, implications of correctness could change). FWIW, automating tests has been invaluable to me for gaining that kind of confidence.
Yeah agreed. And I definitely agree with the automated testing. This is another lacking part of this project, due to how it was born (i.e., out of hackathon).
Thanks again @JoshCheek ! This is great. I tested the import functionality and then merged.
Took another look at this, and since it's been a little bit of time, a solution was easier to see. Not very fond of the solution, but it's simple enough for now. For the future, seems like a better structure is some sort of an enum of return types, one of which is the current
err
, another is a String to return, and others potentially arising in the future.