Sobes.tech
Junior — Senior

What result will be displayed in the console in example №16

livecode

Task condition

What lines will appear in the output when running the following Go program:

import (
        "fmt"
        "runtime"
        "sync"
        "time"
        )

func main() {
    runtime.GOMAXPROCS(1)
    var wg sync.WaitGroup
    wg.Add(1)
    go func(){
        time.Sleep(time.Second * 2)
        fmt.Println("1")
        wg.Done()
    }()
    go func(){
        fmt.Println("2")
    }()
    wg.Wait()
    fmt.Println("3")
}