News for hackers. Stuff that matters.
Re:Go 2 Draft Designs by jerf on Tuesday August 28, 2018 @12:35PM (#17860245)
In your new hotness, I believe that handler is already implicit, so you can just leave it off.

What I am still curious about, and can't see whether or not is possible from the current draft (possible I've just skimmed too hard) is whether printSum can become:

    func printSum(a, b string) error {
        fmt.Println("result:",
            check strconv.Atoi(a) +
            check strconv.Atoi(b))
        return nil
    }
Possibly with an addition paren around the check.

(I'm just using this as an example; in this case I probably would assign x & y on separate lines since in this case this saves no lines, but there are other cases where I've wanted to be able to call a function that has an error but avoid the 4-line dance to unpack it.)

Re:Go 2 Draft Designs by cyphar on Tuesday August 28, 2018 @12:59PM (#17860498)
It can, and this is mentioned in the error chain design doc[1].

[1]: https://go.googlesource.com/proposal/+/master/design/go2draf...

Re:Go 2 Draft Designs by ianlancetaylor on Tuesday August 28, 2018 @12:57PM (#17860483)
Yes, what you write should work with the current draft.
Re:Go 2 Draft Designs by jerf on Tuesday August 28, 2018 @12:57PM (#17860491)
Cool. It isn't something I'd want to abuse, but there are places in my code where it would clean things up nicely, too.
Re:Go 2 Draft Designs by webkike on Tuesday August 28, 2018 @01:03PM (#17860538)
That should be possible because check is an expression