Tagged articles

for-range

2 articles · Page 1 of 1
Golang Shines
Golang Shines
Jul 6, 2026 · Backend Development

Why a Simple for‑range Over a Go Channel Can Leak Goroutines

The article explains how using a for‑range loop to read from an unclosed Go channel can cause a goroutine to block forever, demonstrates the issue with a minimal example, compares explicit receives with for‑range, and shows that closing the channel is the only reliable fix, even for buffered channels.

Gochannelclose
0 likes · 7 min read
Why a Simple for‑range Over a Go Channel Can Leak Goroutines
MaGe Linux Operations
MaGe Linux Operations
Aug 12, 2022 · Fundamentals

Why Go Pointers Trip You Up: Common Pitfalls and Deep Dive

This article explains how Go pointers work, why they differ from C pointers, and highlights frequent mistakes such as struct pointer assignments, for‑range loop quirks, closure captures, and memory‑escape scenarios, providing clear code examples and runtime insights.

Runtimeclosuresfor-range
0 likes · 13 min read
Why Go Pointers Trip You Up: Common Pitfalls and Deep Dive