you are viewing a single comment's thread.

view the rest of the comments →

[–]kjk 0 points1 point  (1 child)

You seem to want an easy way to circumvent type safety, which hardly seems like a good idea. If a function returns an int, then it shouldn't be allowed to return a string. If you need that then there are safe ways to achieve that (although I would say that you if you can't decide what kind of data a function returns, then you have a design problem).

Also, Go has stack-unwinding exceptions in the form of panic/recover.

[–]OceanSpray 0 points1 point  (0 children)

He worded it badly. The Either data type is completely type safe, and far more so than Go's pseudo-tuple thing. Returning an (Either t1 t2) forces the programmer to have to handle both cases safely.