top | item 44172989

(no title)

mseepgood | 9 months ago

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

discuss

order

zffr|8 months 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

tubthumper8|9 months ago

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

bccdee|9 months 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.

mseepgood|9 months ago

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