Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
sayrer
28 days ago
|
parent
|
context
|
favorite
| on:
Cloudflare outage on November 18, 2025 post mortem
Yes, can't have .unwrap() in production code (it's ok in tests)
orphea
28 days ago
|
next
[–]
Like goto, unwrap is just a tool that has its use cases. No need to make a boogeyman out of it.
gishh
28 days ago
|
parent
|
next
[–]
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
27 days ago
|
root
|
parent
|
next
[–]
Nonsense. Linux kernel for one example, uses goto everywhere for error handling.
gishh
23 days ago
|
root
|
parent
|
next
[–]
How many codebases besides the Linux kernel had you seen an intentional amount of use of goto?
orphea
21 days ago
|
root
|
parent
|
next
[–]
The answer is one search away on GitHub.
I will give you one example though: various .NET repositories (runtime, aspnetcore, orleans).
metaltyphoon
28 days ago
|
parent
|
prev
|
next
[–]
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
28 days ago
|
parent
|
prev
|
next
[–]
panicans should be using .expect() in production
keyle
28 days ago
|
prev
[–]
unwrap itself isn't the problem...
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: