Programming Code Center(PCC)
[GO]

(PCC)::[How-to-used-Channel-Synchronization-to-notify-another-goroutine-that-this-functions-work-is-done-in-go-language]::[go]

File Name : channel-synchronization.go

package main

import (
    "fmt"
    "time"
)

func worker(done chan bool) {
    fmt.Print("working...")
    time.Sleep(time.Second)
    fmt.Println("done")

    done <- true
}

func main() {

    done := make(chan bool, 1)
    go worker(done)

    <-done
}

Output :

channel-synchronization.jpg