News for hackers. Stuff that matters.
Re:The Use of assert() in SQLite by marvy on Friday April 26, 2019 @09:36PM (#19763212)
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?

Re:The Use of assert() in SQLite by everdev on Friday April 26, 2019 @10:56PM (#19763478)
You 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.
Re:The Use of assert() in SQLite by bbatha on Saturday April 27, 2019 @12:30AM (#19763788)
The runtime package allows you to grab the current trace, you can just pop the last frame off and print that.
Re:The Use of assert() in SQLite by everdev on Saturday April 27, 2019 @10:04AM (#19765579)
True. The only other challenge is that in production software you rarely want to call panic()
Re:The Use of assert() in SQLite by IanS5 on Saturday April 27, 2019 @12:01PM (#19766161)
As another comment mentioned you can just use build tags to make assert a no-op in release builds
Re:The Use of assert() in SQLite by rabidrat on Friday April 26, 2019 @11:01PM (#19763496)
Also, there is no way to eliminate the assert clause in a high-performance (release) build.