Re:Things about programming I learned with Go
by steveklabnik on Wednesday August 23, 2017 @02:53PM
(#15084096)
The ? RFC did include a "catch" construct, and there's been some discussion about doing something more like "throws SomeError." We'll see!
Re:Things about programming I learned with Go
by alphaalpha101 on Wednesday August 23, 2017 @10:17PM
(#15087120)
It's far too late for "we'll see".
Except instead of just writing `throws SomeError` in the declaration line of the function, you have to annotate virtually every line of your function with `?` and wrap the return line in `Ok(...)`.