Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How would you set a breakpoint on the error return case?


You set a breakpoint directly before this line, and then step forward. If you need the breakpoint to only trigger when there is an error, then you can use a conditional breakpoint that triggers when err != nil


Inline breakpoint, the same way you set a breakpoint on an expression in any language


You wouldn't. Rust's ? operator doesn't permit that either. If you need to put a breakpoint there, put a line break there.


One reason I consider Rust's approach worse than Go's.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: