On Wednesday, November 9, 2016 at 6:29:13 PM UTC+8, Dave Cheney wrote:
>
> There are already too many ways to declare and or assign a variable in Go. 
> Adding more is not a solution. 


how about to prefix a ~ before identifiers to avoid shadowing:

func f() {
    a, err := 1, error.New("an error")
    if err != nil {
        ~a, b, ~err := 2, 3, nil // here the a and err is the outer a and 
err
    }
    
    return a, err
}

-- 
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