News for hackers. Stuff that matters.
Re:Go 1.18 Beta 1 is available, with generics by lucian1900 on Wednesday December 15, 2021 @11:42AM (#29568317)
It would allow functions to be treated generically as returning error-able types. Since some functions even return 3 arguments where the third is the error, this isn't possible today.

It would also allow defer-like syntax to be used on the value a function returns, to return early from the calling function. Rust's ? is an excellent example of this, allowing explicit delegation of error handling that is still very lightweight syntactically.

There are no comments on this comment yet.