Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
orphea
7mo ago
0 comments
Save
Share
Like goto, unwrap is just a tool that has its use cases. No need to make a boogeyman out of it.
0 comments
5 comments · 3 top-level
top
newest
oldest
gishh
7mo ago
· 2 in thread
To be fair, if you’re not “this tall” you really shouldn’t consider using goto in a c program. Most people aren’t that tall.
tucnak
7mo ago
Nonsense. Linux kernel for one example, uses goto everywhere for error handling.
gishh
7mo ago
How many codebases besides the Linux kernel had you seen an intentional amount of use of goto?
1 more reply
metaltyphoon
7mo ago
Yes it's meant to be used in test code. If you're sure it can't fail do then use .expect() that way it shows you made a choice and it wasn't just a dev oversight.
fwjafwasd
7mo ago
panicans should be using .expect() in production
j
/
k
navigate · click thread line to collapse