在编程中打勾

I run following code on a tour of go website

package main

import "time"
import "fmt"

func main() {
    c := time.Tick(1 * time.Minute)
    for now := range c {
         fmt.Printf("%v
", now)
    }
}

But it said throw: all goroutines are asleep - deadlock!

goroutine 1 [chan receive]:
main.main()
    /tmpfs/gosandbox-25c44134_87776a49_1b5620b3_abba0ea7_70540ccf/prog.go:8 +0x53

Is it a problem of their side or problem in my code?

[WorksForMe]

If you're running this code on golang.org it's not going to work. Its rules are a little different, and it doesn't allow this kind of sleeping. Instead install the Go compiler locally and run it on your own computer.

Also, you'll probably want to change time.Minute to time.Second so that you can see what it's actually doing without having to wait an entire minute.