package main

import (
    "fmt"
    "time"
    )

func download(ch chan string) {
    time.Sleep(1 * time.Second)         
    ch <- "Download complete!"
}

func main() {
    ch := make(chan string)
    go download(ch)
    fmt.Println("Downloading...")
    fmt.Println(<-ch) // blocks until channel has data
    fmt.Println("End of main()")
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: