Re:Conc: Better Structured Concurrency for Go
by aetherane on Wednesday January 11, 2023 @09:36PM
(#34348439)
It is pretty easy to have accidental panics in Go, for instance due to a runtime assertion that unexpectedly failed
[ Parent
| on HN ]
Re:Conc: Better Structured Concurrency for Go
by preseinger on Thursday January 12, 2023 @06:27PM
(#34361737)
Runtime assertions without defensive checks are programmer errors that are not difficult to spot in code review and should not be expected to make it to deployed code.
// RED FLAG
x := y.(type)
// good
x, ok := y.(type)
if !ok { return an error }