fun f6() int {
var i int = 0
defer func(a int) {
fmt.Println("i f6:", a)
i = i+5
}(i)
i = 1
iPP
return i
}
according to the rewriting rule, the return statement is separated into two sentences., return xxx will be rewritten as:
return value = xxx
call defer function
empty return
iTun0
return value r = i (i equals 0)
iTun1
iPP (i equals 2)
return r (I think it should be 0)
Why is the result 2?