|
|
|
|
|
by jgrant27
1710 days ago
|
|
Have you debugged.it ?
Debugging seems to be the author's coding philosophy which says it all. While I had over a decade of experience in other languages, such as Python, PHP, Java, etc.
I found it extremely difficult to wrap my head around Go.
This could be because the author's introduction to programming and most of their experience has been with some very problematic languages.Maybe it's not Go that is a terrible language but just that the author is not a systems programmer who has worked with large code bases ? |
|
1. Take the line number where the error was logged, likely somewhere very close to e.g. the main event handling loop, and completely disconnected from the place where the error was initially thrown. There is no stack trace.
2. Try to figure out which parts of the error string are constant (i.e. searchable), and pray for the developer to have been familiar with the issue so that the string is globally unique (corollary: When writing Go, make sure your error strings are unique, introduce some form of variation if you're throwing similar errors, even if it's just punctuation or synonyms, to make sure the throw site is identifiable).
3. Try to guess what the flow between those two sites could have been.
The lack of proper stack traces (or even the line number where the error was thrown) on errors is one of the most insane effects of this error handling approach. (The other is hard to read code because the actual logic is hidden in 3x as much error handling boilerplate).