Tagged articles

empty struct

5 articles · Page 1 of 1
Golang Shines
Golang Shines
Jun 11, 2026 · Fundamentals

8 Subtle Go Language Details You Might Not Know

This article walks through eight often‑overlooked Go features—including direct integer iteration in Go 1.22, the ~T generic constraint, UTF‑8 string length pitfalls, nil‑interface quirks, nil‑pointer method calls, proper timer usage with contexts, zero‑size struct semaphores, and the JSON "-" tag—showing concrete code examples and the reasoning behind each behavior.

contextempty structgenerics
0 likes · 9 min read
8 Subtle Go Language Details You Might Not Know
Tech Musings
Tech Musings
Feb 17, 2026 · Backend Development

Why Go’s Empty Struct Takes Zero Bytes and How to Leverage It

This article explains the zero‑byte nature of Go’s empty struct, how the runtime treats zero‑size allocations, why multiple instances share the same address, and demonstrates practical patterns such as set maps, signal channels, and worker coordination that improve memory efficiency and performance.

Zero Allocationchannel signalingempty struct
0 likes · 11 min read
Why Go’s Empty Struct Takes Zero Bytes and How to Leverage It
Golang Shines
Golang Shines
Feb 15, 2026 · Fundamentals

8 Subtle Go Language Details You Might Not Know

This article walks through eight often‑overlooked Go language nuances—ranging from direct integer iteration and generic type constraints to UTF‑8 string length, nil interface pitfalls, safe nil method calls, time.After resource leaks, empty‑struct semaphores, and JSON field omission—showing concrete code examples, common mistakes, and recommended practices.

empty structgenericsgo
0 likes · 9 min read
8 Subtle Go Language Details You Might Not Know
Go Programming World
Go Programming World
Jun 4, 2024 · Backend Development

Understanding and Using Empty Structs (struct{}) in Go

This article explains the zero‑size nature of Go's empty struct, demonstrates how its memory address behaves, shows its impact on struct alignment, and presents multiple practical patterns such as set implementation, large arrays, signal channels, no‑op methods, interface stubs, and the noCopy identifier.

Setchannelempty struct
0 likes · 17 min read
Understanding and Using Empty Structs (struct{}) in Go