Comment

Comment by gmfawcett

That's simply not true. There is no recovering from a failed assert. Go's recover() allows recovering from panics.

Further, it is considered good practice to recover from panics within library API boundaries, and return errors across the API instead. "The convention in the Go libraries is that even when a package uses panic internally, its external API still presents explicit error return values."[1]

[1] https://blog.golang.org/defer-panic-and-recover

parent gmfawcett 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton