mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
Set node address in `val` field at creation of `funcDecl` node so it can be used correctly at closure generation, even in the case of forward function declarations, where the value was zero. Fixes #1214
26 lines
226 B
Go
26 lines
226 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"sync"
|
|
)
|
|
|
|
func main() {
|
|
var wg sync.WaitGroup
|
|
wg.Add(1)
|
|
go func() {
|
|
defer wg.Done()
|
|
|
|
print("test")
|
|
}()
|
|
|
|
wg.Wait()
|
|
}
|
|
|
|
func print(state string) {
|
|
fmt.Println(state)
|
|
}
|
|
|
|
// Output:
|
|
// test
|