What is the difference between panic and an assert?
- by acidzombie24
Go doesn't provide assertions. They are undeniably convenient, but our experience has been that programmers use them as a crutch to avoid thinking about proper error handling and reporting.
However it has print and println which does
panic like print, aborts execution after printing
panicln like println, aborts execution after printing
Isnt that the same thing as an assert? Why would they claim the above but have panic? i can see it leading to the same problems but adding an error msg to the end of it which can easily be abused. Am i missing something?