This works.

var tick <-chan time.Time = time.Tick(1e8)

However, this does not.

var tick chan time.Time = time.Tick(1e8)

Why do I need a <- in my type declaration for a channel? I thought that <- was for writing to or reading from a channel. Why would it appear in a type?

go
Edit
Report