3 ms·
It's better because you do not need to remember to check for nil, the compiler will remind you every time by erroring out until you handle the second return val
by Mawr 2y ago
It's better because you do not need to remember to check for nil, the compiler will remind you every time by erroring out until you handle the second return value of `option.Get()`.
> Of course, this is often left out, but you can just as easily do:
Unfortunately it gets brought up pretty much every time in these discussions.
Deliberate attempts to circumvent safety are not part of the threat model. The goal is prevention of accidental mistakes. Nothing can ultimately stop you from disabling all safeties, pointing the shotgun at your foot and pulling the trigger.