News for hackers. Stuff that matters.
Re:Go Replaces Interface{} with 'Any' by eru on Tuesday December 14, 2021 @11:51PM (#29562247)
The '?' is not a conceptual advance over .unwrap(), it's "just" a major syntactic convenience.
Re:Go Replaces Interface{} with 'Any' by ComputerGuru on Wednesday December 15, 2021 @02:10AM (#29562947)
Of course it is. Unwrap panics on error, while ? bubbles up the error instead. But ? wasn’t introduced to replace unwrap, unwrap was always frowned upon. It instead replaces match and return.
Re:Go Replaces Interface{} with 'Any' by imron on Wednesday December 15, 2021 @04:17AM (#29563662)
It was always frowned upon, but still ended up everywhere (including lots of documentation and example code) because it was less verbose than the match handling. The ? helped remove that last obstacle.