3 ms·
To draw_down: your comments are showing up as dead, As for assert in Go... couldn't you just make a function that takes a Boolean and panics?
by marvy 7y ago
To draw_down: your comments are showing up as dead,
As for assert in Go... couldn't you just make a function that takes a Boolean and panics?
- everdev 7y agoYou could, but then when you get an error, you'll see the file and line number of the assert function rather than the code that actually produced the error.
- bbatha 7y agoThe runtime package allows you to grab the current trace, you can just pop the last frame off and print that.
- rabidrat 7y agoAlso, there is no way to eliminate the assert clause in a high-performance (release) build.