News for hackers. Stuff that matters.
Re:Next steps toward Go 2 by atombender on Wednesday June 26, 2019 @04:04PM (#20288595)
One downside to this is that doesn't work for functions those return values aren't disjoint.

io.Reader is an example where the function can return io.EOF and still returns valid data together with a count in its first return value. If it returns a count > 0, the buffer has valid data. A lot of Go projects get this wrong because it's not obvious -- it goes against the behaviour of almost all Go functions.

Go is unfortunately full of little surprising warts like this where you have to tread super carefully. Nil channels is one of my favorites.

Re:Next steps toward Go 2 by frou_dh on Wednesday June 26, 2019 @06:35PM (#20289963)
What a thorn the design of that Read method is, because it has caused perennial FUD against the validity of sum typing in Go circles.
Re:Next steps toward Go 2 by atombender on Wednesday June 26, 2019 @06:58PM (#20290140)
Has it come up a lot in Go proposals discussions?
Re:Next steps toward Go 2 by frou_dh on Wednesday June 26, 2019 @07:08PM (#20290221)
Dunno, I meant reddit flamewars etc.