Hello
It seems that this code <https://play.golang.org/p/C5jbcieUS6> doesn't 
compile :

func main() {
    var err error
    err = f()
}

*prog.go:8: err declared and not used*


but this one <https://play.golang.org/p/Y5zc4sLbtE> does :

func main() {
    var err error
    g := func() {
        err = f()
    }
    g()
}

Is the function binding regarded as a "use"?  Or does escape analysis 
decide to not check too deep about never-read variables?

Whether expected or not, I supposed this compiler behavior won't change, 
because of the Go1 compatibility promise.

Cheers
 Val

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to