Tagged articles
13 articles
Page 1 of 1
21CTO
21CTO
Sep 19, 2025 · Backend Development

Why Go’s Error Handling, Defer, and Nil Design Feel Like Bad Ideas

The article critiques Go’s language design by highlighting unnecessary patterns such as overly broad error‑variable scopes, confusing nil semantics, cumbersome defer usage, hidden memory costs, and a lack of clear ownership, illustrating each point with concrete code examples and comparing alternatives in other languages.

Error Handlingdeferlanguage design
0 likes · 11 min read
Why Go’s Error Handling, Defer, and Nil Design Feel Like Bad Ideas
FunTester
FunTester
Mar 13, 2025 · Backend Development

When to Use Value vs Pointer Receivers and Other Go Pitfalls You Must Avoid

This article examines common Go mistakes—including choosing between value and pointer receivers, misusing unnamed or named return values, returning nil interfaces, passing filenames instead of readers, and defer parameter evaluation—provides clear explanations, real‑world examples, and best‑practice recommendations to write more reliable Go code.

Gobest practicesdefer
0 likes · 18 min read
When to Use Value vs Pointer Receivers and Other Go Pitfalls You Must Avoid
Go Programming World
Go Programming World
Feb 19, 2024 · Backend Development

Implementing Context Managers in Go: Emulating Python's with Using defer and Anonymous Functions

This article explores how to replicate Python's context manager behavior in Go by examining defer's delayed execution, demonstrating its limitations in loops, and presenting three solutions—anonymous functions, a WithClose helper, and a withLock-inspired pattern—to ensure timely resource release.

GoResource ManagementWithClose
0 likes · 10 min read
Implementing Context Managers in Go: Emulating Python's with Using defer and Anonymous Functions
Python Crawling & Data Mining
Python Crawling & Data Mining
Nov 9, 2020 · Fundamentals

Master Go Functions: Scope, Defer, Panic & Recover Explained

This article delves into advanced Go function concepts, illustrating memory allocation diagrams, variable scopes, the use of const for globals, the behavior of defer statements, and handling errors with panic and recover, complete with code examples and visual outputs to deepen your understanding.

GoVariable Scopeconst
0 likes · 8 min read
Master Go Functions: Scope, Defer, Panic & Recover Explained
360 Tech Engineering
360 Tech Engineering
Apr 13, 2020 · Backend Development

Understanding Exception and Error Handling in Go

This article explains how Go handles exceptions and errors using defer, panic, and recover, compares it with try‑catch in other languages, demonstrates the built‑in error interface, custom error types, and provides multiple code examples and analyses of their output.

Error HandlingExceptionGo
0 likes · 6 min read
Understanding Exception and Error Handling in Go