The comparison here is to Go, which doesn't have any way to handle memory allocation failure AFAIK.
In Rust you can do that (mostly on nightly although not only), and yes there are alternatives for this case, but it's rare anyway.