Tagged articles

empty interface

10 articles · Page 1 of 1
Golang Shines
Golang Shines
Jun 16, 2026 · Fundamentals

Understanding Three Key Features of Go Interfaces

The article explains Go's static typing, shows how interface types are method sets—including the empty interface—demonstrates type assertions, and walks through using the reflect package to inspect and modify values, highlighting settable constraints and struct field updates.

GoInterfacesReflection
0 likes · 15 min read
Understanding Three Key Features of Go Interfaces
Golang Shines
Golang Shines
Jun 13, 2026 · Fundamentals

Mastering Go Interfaces and Polymorphism: A Deep Dive

This article explains how Go interfaces define behavior contracts, how implicit implementation, empty interfaces, and type assertions work, demonstrates polymorphic patterns with payment and animal examples, and highlights common pitfalls such as nil interfaces, method‑signature mismatches, pointer vs. value receivers, and interface composition.

GoInterfaceProgramming Fundamentals
0 likes · 16 min read
Mastering Go Interfaces and Polymorphism: A Deep Dive
Golang Shines
Golang Shines
May 8, 2026 · Fundamentals

Deep Dive into Go’s Core Mechanisms: Pointers, defer, Polymorphism, and Empty Interface in Practice

This article systematically explores Go's most confusing features—including pointer semantics, defer execution order, lightweight object‑oriented patterns via struct embedding, interface‑based polymorphism, and the empty interface with type assertions—through over twenty runnable code snippets that reveal the underlying design principles.

GoInterfacesPointers
0 likes · 17 min read
Deep Dive into Go’s Core Mechanisms: Pointers, defer, Polymorphism, and Empty Interface in Practice
Raymond Ops
Raymond Ops
Mar 19, 2025 · Fundamentals

Unlocking Go’s Empty Interface: How Any Type Becomes a Value

This article explains Go’s empty interface, showing how it can hold values of any type, how to declare and use it in functions and data structures, and why copying between concrete slices and empty‑interface slices requires element‑wise assignment due to its two‑word memory layout.

GoInterfaceempty interface
0 likes · 5 min read
Unlocking Go’s Empty Interface: How Any Type Becomes a Value
Liangxu Linux
Liangxu Linux
Aug 4, 2024 · Backend Development

Mastering Go’s Empty Interface: Store Any Type and Copy Data Safely

This guide explains Go's empty interface, how any value can be stored in it, demonstrates declaring variables and functions with interface{}, shows practical slice examples, discusses memory layout, and provides the correct way to copy data into an empty‑interface slice.

Interfaceempty interfacegolang
0 likes · 5 min read
Mastering Go’s Empty Interface: Store Any Type and Copy Data Safely
MaGe Linux Operations
MaGe Linux Operations
Jun 29, 2024 · Fundamentals

Unlock Go’s Empty Interface: Store Any Type Anywhere

An empty interface in Go, defined without methods, can hold values of any type, enabling flexible data structures like slices, maps, and structs, and is commonly used in functions such as fmt.Println; this article explains its definition, usage, memory layout, and copying nuances with code examples.

Code examplesempty interfacegeneric programming
0 likes · 6 min read
Unlock Go’s Empty Interface: Store Any Type Anywhere
MaGe Linux Operations
MaGe Linux Operations
Apr 29, 2024 · Fundamentals

Unlocking Go’s Empty Interface: Store Any Type in One Variable

An empty interface in Go, defined as interface{}, can hold values of any type because it has no methods, enabling flexible data structures like slices, maps, and structs, and is commonly used in functions such as fmt.Println, though copying between typed and empty interface slices requires careful handling.

GoInterfaceempty interface
0 likes · 5 min read
Unlocking Go’s Empty Interface: Store Any Type in One Variable
MaGe Linux Operations
MaGe Linux Operations
Apr 27, 2024 · Fundamentals

Mastering Go Types and Interfaces: A Deep Dive into Reflection

This article explains Go's static type system, introduces custom types and interface definitions, demonstrates how interfaces store concrete values, and shows how the reflect package can inspect and modify values, covering empty interfaces, type assertions, and mutable reflect values with practical code examples.

InterfacesReflectionStatic Typing
0 likes · 14 min read
Mastering Go Types and Interfaces: A Deep Dive into Reflection
TiPaiPai Technical Team
TiPaiPai Technical Team
Jun 11, 2021 · Fundamentals

What Happens Inside Go’s Empty Interface? A Deep Dive into Memory Layout

This article explores how Go implements the empty interface (interface{}) at the binary level, detailing stack frame allocation, compiler‑generated helper functions, pointer structures, and runtime optimizations that together reveal why an empty interface is essentially two consecutive pointers in memory.

Goempty interfacememory layout
0 likes · 11 min read
What Happens Inside Go’s Empty Interface? A Deep Dive into Memory Layout