Re:Quick and Clean in Go
by flogic on Wednesday August 01, 2012 @07:13PM
(#4326287)
If Panic doesn't cross goroutine boundaries, why should exceptions?
[ Parent
| on HN ]
Re:Quick and Clean in Go
by drivebyacct2 on Wednesday August 01, 2012 @07:24PM
(#4326338)
The whole point is, it wouldn't make sense for them to cross goroutine boundaries, but the pleasure of Go is the ease with which you can use goroutines. Thus, in a lot of places where people would lazily use exceptions to aggregate potential errors, you would be unable to because the exception is occuring in a goroutine.
Which is why there are other nice ways of communicating such states in go that go hand in hand with handling errors at their occurrence. If you find an error in a goroutine, you can signal that on a channel, return and wait for a new goroutine to be restarted in place of the errored one.