Skip to content

Comment on Free screencasts to learn Go

Comments

The commentary in the channel one is a bit off. With size 1+ it's a buffered channel and as such you could do what's shown in a single goroutine without blocking:

    package main

    func main() {
        c := make(chan bool, 1)
        c <- true
        println(<-c)
    }
It'd be unbuffered if there were no holding space, i.e. make(chan bool, 0) or simply make(chan bool)†. Cool project though - subscribed.

---

† Yes, built-in functions get not only generics privilege, but overloading too. It's evidently not as pitchfork-worthy.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.