The idea of As is to find an error in the wrapped errors, the error chain, 
which can be cast to the type you pass.

I played a bit with them and made some examples: 
https://github.com/AndersonQ/go1_13_errors/blob/master/main.go#L103
Have a look in the implementation of As, it's nice and simple to understand 
:) you migh eve try to debug to see it in action.


On Thursday, 24 October 2019 10:26:25 UTC+2, Gert wrote:
>
> Hi, I fail to understand how the custom As is suppose to work?
>
> see example https://play.golang.org/p/tjuItX5dHoJ
>
>

-- 
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/67b131d7-dd2c-43cd-a5f1-56e797d0d57a%40googlegroups.com.

Reply via email to