Tagged articles
empty interface
10 articles · Page 1 of 1
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.
GoReflectionempty interface
0 likes · 15 min read

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.
GoPolymorphismempty interface
0 likes · 16 min read

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.
GoPolymorphismdefer
0 likes · 17 min read

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.
GoMemory LayoutType System
0 likes · 5 min read

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.
Type Conversionempty interfacegolang
0 likes · 5 min read

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 ExamplesType Systemempty interface
0 likes · 6 min read

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.
GoType Systemempty interface
0 likes · 5 min read

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.
Reflectionempty interfaceinterfaces
0 likes · 14 min read

This article explains Go's static type system, how types and interfaces work, the role of the empty interface, and demonstrates using the reflect package to inspect and modify values, including structs, with practical code examples and type assertions.
GoReflectionStruct
0 likes · 15 min read

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.
GoMemory LayoutRuntime
0 likes · 11 min read
