github.com/neugram/ng@v0.0.0-20180309130942-d472ff93d872/eval/testdata/func5.ng (about) 1 ok := false 2 func f(x int) { 3 ok = true 4 return 5 } 6 7 f(42) 8 9 if !ok { 10 panic("ERROR 1") 11 } 12 13 i := 3 14 func g() (i int) { 15 i = 42 16 return i 17 } 18 19 if v := g(); v != 42 { 20 panic("ERROR 2") 21 } 22 23 if i != 3 { 24 panic("ERROR 3") 25 } 26 27 print("OK")