Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
awb
on April 27, 2019
|
parent
|
context
|
favorite
| on:
The Use of assert() in SQLite
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.
bbatha
on April 27, 2019
[–]
The runtime package allows you to grab the current trace, you can just pop the last frame off and print that.
awb
on April 27, 2019
|
parent
[–]
True. The only other challenge is that in production software you rarely want to call panic()
IanS5
on April 27, 2019
|
root
|
parent
[–]
As another comment mentioned you can just use build tags to make assert a no-op in release builds
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: