Y
Hacker News
new
|
ask
|
show
|
jobs
by
mseepgood
375 days ago
How would you set a breakpoint on the error return case?
3 comments
zffr
369 days ago
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
link
tubthumper8
375 days ago
Inline breakpoint, the same way you set a breakpoint on an expression in any language
link
bccdee
375 days ago
You wouldn't. Rust's ? operator doesn't permit that either. If you need to put a breakpoint there, put a line break there.
link
mseepgood
375 days ago
One reason I consider Rust's approach worse than Go's.
link