Closed
Description
Line 6452 in 049c8db
the code as spec#Package_initializationthe
package main
import "fmt"
var (
a = c + b
b = f()
c = f()
d = 3
)
func f() int {
d++
return d
}
func main() {
fmt.Println("a", a)
fmt.Println("b", b)
fmt.Println("c", c)
fmt.Println("d", d)
}
got
result:
a 9
b 5
c 4
d 5
but with the order in spec d-> b -> c -> a, I think the expect result shoud be
a 9
b 4
c 5
d 5
if I change a = c + b
to a = b + c
the order is same as spec init order d b c a
so is there something wrong?
my go version is go version go1.12.4 linux/amd64