Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
mseepgood
· 1y ago · 0 comments
How would you set a breakpoint on the error return case?
Comments
[–]
zffr
1y 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
1y ago
Inline breakpoint, the same way you set a breakpoint on an expression in any language
[–]
bccdee
1y 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
OP
1y ago
One reason I consider Rust's approach worse than Go's.