Tagged articles
defer
18 articles · Page 1 of 1
This article breaks down the five Go interview questions interviewers love, explains the underlying concepts such as goroutine and channel mechanics, empty‑interface pitfalls, map concurrency, defer execution, and Go modules, provides high‑scoring code examples, and offers concrete preparation tips to showcase engineering thinking and practical skills.
ConcurrencyGoInterview
0 likes · 9 min read

The article explains Go’s philosophy of treating errors as ordinary return values, contrasts it with try‑catch in other languages, illustrates three error scenarios (error, panic, recover) with food‑delivery analogies, provides concrete code examples, and outlines best practices and common pitfalls for safe error handling in Go.
Godefererror handling
0 likes · 11 min read

This article presents a curated collection of 30 essential Go interview questions covering language characteristics, object‑orientation, inheritance, polymorphism, goroutine basics, channel usage, defer execution order, memory allocation, slice vs array, map safety, error handling, context, Go modules, the GMP scheduler, and practical code examples for testing and middleware.
ConcurrencyContextGo
0 likes · 11 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 defer semantics, its interaction with return statements, parameter evaluation rules, performance impact in hot paths, and proper use with panic‑recover, providing practical code examples and best‑practice recommendations.
Godeferpanic/recover
0 likes · 7 min read


21CTOSep 19, 2025 · Backend Development
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.
defererror handlinglanguage design
0 likes · 11 min read

This article demonstrates a concise technique for intercepting Go panics, logging detailed error messages and stack traces using defer, recover, and debug.Stack, and explains when and how to apply it in development and production environments.
DebuggingGodefer
0 likes · 8 min read

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.
Best PracticesGodefer
0 likes · 18 min read

This article explains Go's defer keyword, covering its purpose, LIFO execution, design goals for simplifying resource management and error handling, internal implementation details, common use cases like cleanup and logging, and performance considerations with practical code examples.
Godefererror handling
0 likes · 9 min read

This article explains the differences between the default, async, and defer script attributes in HTML, showing how each affects script loading and HTML parsing, with detailed code examples, execution order diagrams, and practical recommendations for choosing the right attribute.
HTMLScriptasync
0 likes · 10 min read

This article explains how Go's defer statement works, when it may be skipped, how return statements interact with it, and provides practical guidelines to ensure reliable resource cleanup in robust Go programs.
Backendbest-practicesdefer
0 likes · 5 min read

This article explains how React Router 6.4’s new Data APIs—loader functions, defer, and the Await component—separate data fetching from rendering, improve client‑side and server‑side rendering performance, and provide a smoother user experience through progressive loading and streaming.
Data APIsReact RouterSSR
0 likes · 24 min read

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.
GoWithCloseanonymous function
0 likes · 10 min read

This article explains how Go's defer statements evaluate arguments, interact with panic, affect return values, and behave with os.Exit, providing clear code examples and conclusions to help developers avoid common mistakes.
defererror handlingpanic
0 likes · 5 min read

This article compares three Go transaction implementations, explains their trade‑offs, and presents a refined pattern that uses defer tx.Rollback() to guarantee rollback while still allowing successful commits, covering both simple and loop‑based use cases.
Backenddatabasedefer
0 likes · 5 min read

This article explains the internal workings of Golang v1.0 coroutines, covering their creation, stack‑switching logic, scheduler design, virtual‑memory basics, assembly examples, channel handling, socket event loops, and the low‑level implementation of defer, panic, and recover.
Concurrencyassemblydefer
0 likes · 33 min read

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

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.
ExceptionGodefer
0 likes · 6 min read
