6 ms·
If you give Go to the community, the community will add exceptions... yuck.
by szuze 7y ago
If you give Go to the community, the community will add exceptions... yuck.
- josefx 7y agoGo already has panic/recover which where explicitly proposed as an exception like mechanism for go.
- BrandoElFollito 7y agoThe convention in the Go libraries is that even when a package uses panic internally, its external API still presents explicit error return values. -- https://blog.golang.org/defer-panic-and-recover https://blog.golang.org/defer-panic-and-recover I belive this means that using this mechanism similarly to try/except in Python is not possible (I write 20 lines in go so this is quite a wild guess)
- baby 7y agoAnd generics, ew