On Sat, Aug 26, 2023 at 07:56:30AM -0700, Aln Kapa wrote:
> Need some help, what am I doing wrong?

You don't understand how defer works would be my guess

> func main() {
> Handle(true)    // error
> Handle(false)   // no error
> HandleWTF(true) // no error ?????????

Why do you expect this to print an error?
The deferred call's arguments are evaluated immediately, but the function call 
is not executed until the surrounding function returns.

At the time it is evaluated, err is nil

-- 
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/chscpzfrzxtstele4rmh2lzt37n2xb2dcrltpopcj4c233goo7%40jq4ervvogvmp.

Reply via email to