Tagged articles
2 articles
Page 1 of 1
Ops Development & AI Practice
Ops Development & AI Practice
May 9, 2024 · Backend Development

When to Replace Pointer Receivers with Value Receivers in Go?

This article examines the trade‑offs of converting a Go method from a pointer receiver to a value receiver, illustrating the change with concrete code examples, outlining benefits such as simpler logic, zero‑value safety, clearer semantics, and offering guidance on when this refactor is appropriate.

Gocode safetymethod receiver
0 likes · 5 min read
When to Replace Pointer Receivers with Value Receivers in Go?
Didi Tech
Didi Tech
May 9, 2019 · Fundamentals

Deep Dive into Go Interfaces: Duck Typing, Receivers, Interface Internals, and Polymorphism

The article thoroughly examines Go’s interface system, explaining static duck typing, the differences between value and pointer receivers, the internal iface/eface structures, how interfaces are constructed and converted, compiler implementation checks, type assertions, runtime polymorphism, and contrasts these mechanisms with C++ abstract‑class interfaces.

GoPolymorphismduck-typing
0 likes · 39 min read
Deep Dive into Go Interfaces: Duck Typing, Receivers, Interface Internals, and Polymorphism