package main import ( "fmt" "time" ) func hoge(done chan int64) { // chan int64 type for i := 0; i < 5; i++ { fmt.Println(i) time.Sleep(1 * time.Second) } done <- 10 // send } func main() { done := make(chan int64) go hoge(done) x := <- done // receicve fmt.Println(x) // 10 }