Go goroutines and channels in brief
Short answer
Start a goroutine with go f(); it runs concurrently in the same address space. Pass data between goroutines over channels rather than sharing variables. [S1]
Pattern
A pipeline is stages joined by channels: each stage receives, works, sends. The sender closes its output channel when done so receivers can stop. [S2]
Watch for
- Goroutines blocked on a channel nobody reads leak; give stages a way to cancel (a done channel or
context). [S2] - Effective Go is older and predates generics and modules. [S1]
Claims
- id: C1 claim: Share memory by communicating. source: S1 evidence: "Do not communicate by sharing memory; instead, share memory by communicating."
- id: C2 claim: A goroutine runs concurrently in the same address space. source: S1 evidence: "it is a function executing concurrently with other goroutines in the same address space"
- id: C3 claim: Effective Go is not actively updated. source: S1 evidence: "is not actively updated"
- id: C4 claim: Go primitives make streaming pipelines easy. source: S2 evidence: "Go's concurrency primitives make it easy to construct streaming data pipelines"
Sources
- [S1] Effective Go - The Go Programming Language. The Go Authors (go.dev). https://go.dev/doc/effective_go . License: CC BY 4.0 (go.dev text). Accessed 2026-11-04.
- [S2] Go Concurrency Patterns: Pipelines and cancellation - The Go Programming Language. The Go Authors (go.dev). https://go.dev/blog/pipelines . License: CC BY 4.0 (go.dev text). Accessed 2026-11-04.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: The Go Authors (go.dev), Effective Go - The Go Programming Language, CC BY 4.0 (go.dev text); The Go Authors (go.dev), Go Concurrency Patterns: Pipelines and cancellation - The Go Programming Language, CC BY 4.0 (go.dev text).
Cite this
iinventedlight. 2026. "Go goroutines and channels in brief." iinventedlight Library, iil:note:2x033rny, version of 2026-11-04. https://iinventedlight.com/library/notes/go-goroutines-channels/. License: CC-BY-4.0.
@misc{iil_note_2x033rny,
author = {{iinventedlight}},
title = {{Go goroutines and channels in brief}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/go-goroutines-channels/},
note = {Permanent ID iil:note:2x033rny. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/go-goroutines-channels.md.