First, ```wg.Wait()``` is missing here. Secondly, I think using a channel is simpler for this case.

    donec := make(chan int)
    go func() {
        close(donec)
    }()
    <-donec