Tech article
Go Concurrency Distilled
No preview is available. Read the original article for the full story.
Hacker News | Sep 26, 2026 | chmaynard
Automated excerpt
When the sending goroutine writes a value to the channel (ch <- val), it blocks and waits for someone to receive that value (<-ch). Once all values are taken, it returns a zero value and a false status, like a regular channel:stream := make(chan int, 1) nil channelLike any type in Go, channels have a zero value, which is nil. Writing to or reading from a nil channel blocks the goroutine indefinitely:var stream chan int SelectThe select statement is somewhat like switch, but specifically designed for channels. To acquire the semaphore, send a value into the channel.
Selected automatically from source text; not independently written or fact-checked. Read the original for full context.