channel in Go

package main
import (  
    "fmt"
)

func test(done chan bool) {  
    fmt.Println("test func goroutine")
    done <- true
}
func main() {  
    done := make(chan bool)
    go test(done)
    <-done
    fmt.Println("main function")
}


output :

test func goroutine
main function

Note : Getting the data from channel using:
data := <- a // read from channel a
a <- data // write to channel a