On Wed, 2022-07-20 at 22:51 +0200, 'Axel Wagner' via golang-nuts wrote:
> The reason reflect uses panic, is for convenience. It would be
> inconvenient having to check an error at every reflect call.

The other reason is that a panic in reflect is as close as you can get
in runtime to a compile error, which is what the non-reflect based
equivalents would generally give you for the errors that panic in
reflect.

Dan

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/db3c17c326f72d37e975c64337e4dd6cd2640b5c.camel%40kortschak.io.

Reply via email to