Please format the error messages according to the Error style guide. Error strings should not start with a capital letter because they'll often be prefixed before printing. github.com/golang/go/wiki/Errors
The trySolve method name is confusing. A better name will be isSolvable or canBeSolved as it returns a boolean.
The trySolveRecursive method checks what the trySolvedoes in the beginning so you have code duplication.
I wasn't aware of the error message convention and I'll make sure to fix that up and adhere to it in future.
Regarding your other comments, I definitely agree the method naming there could be improved, and I'm also going to do a bit of refactoring to avoid the bit of duplication you mentioned.
Log in to continue
We're a place where coders share, stay up-to-date and grow their careers.
Criticisms - Cynicisms:
trySolve
method name is confusing. A better name will beisSolvable
orcanBeSolved
as it returns a boolean.trySolveRecursive
method checks what thetrySolve
does in the beginning so you have code duplication.Thanks for the feedback!
I wasn't aware of the error message convention and I'll make sure to fix that up and adhere to it in future.
Regarding your other comments, I definitely agree the method naming there could be improved, and I'm also going to do a bit of refactoring to avoid the bit of duplication you mentioned.