Tagged articles

defer

15 articles · Page 1 of 1
Golang Shines
Golang Shines
Jul 3, 2026 · Backend Development

Top Go Interview Questions: defer, GMP Scheduler, Slice Internals, Channels, and Context

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.

ChannelContextGo
0 likes · 11 min read
Top Go Interview Questions: defer, GMP Scheduler, Slice Internals, Channels, and Context
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
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.

FunctionsGoVariable Scope
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