Nullbody Notes
Author

Nullbody Notes

Go backend development, learning open-source project source code together, focusing on simplicity and practicality.

60
Articles
0
Likes
0
Views
0
Comments
Recent Articles

Latest from Nullbody Notes

60 recent articles
Nullbody Notes
Nullbody Notes
Jan 12, 2021 · Fundamentals

How to Dynamically Add Features in Go Using the Decorator Pattern

The article explains the Decorator pattern in Go, defining it as a way to add behavior to objects without altering their structure, illustrates the concept with everyday analogies and provides complete Go code examples—including a basic Showable interface, a plain Girl struct, and makeup decorators that wrap the original object—to demonstrate how layered decorations work transparently at runtime.

Decorator PatternDesign PatternsGo
0 likes · 4 min read
How to Dynamically Add Features in Go Using the Decorator Pattern
Nullbody Notes
Nullbody Notes
Jan 11, 2021 · Fundamentals

Understanding Go's Composite Pattern: Building Hierarchical Structures

This article explains the Composite (part‑whole) design pattern in Go, illustrates its concept with natural and file‑system analogies, and provides complete Go code demonstrating how files and folders can be treated uniformly as tree nodes.

Composite PatternDesign PatternsFile System
0 likes · 6 min read
Understanding Go's Composite Pattern: Building Hierarchical Structures
Nullbody Notes
Nullbody Notes
Jan 7, 2021 · Fundamentals

Understanding the Bridge Pattern in Go: Decoupling Shapes and Pens

This article explains the Bridge design pattern in Go by defining its purpose, illustrating how Shape and Pen interfaces can be combined through a Bridge struct, and providing a complete Go code example that demonstrates interchangeable colors and shapes.

Bridge PatternDesign PatternsGo
0 likes · 3 min read
Understanding the Bridge Pattern in Go: Decoupling Shapes and Pens
Nullbody Notes
Nullbody Notes
Dec 30, 2020 · Fundamentals

Essential Shell Commands and Scripting Techniques You Must Know

This article provides a comprehensive guide to Shell scripting, covering variable definition, arithmetic, string manipulation, arrays, quoting rules, control structures, functions, command‑line parsing, debugging, common text‑processing tools, file attribute changes, file management, user and group administration, disk utilities, and includes practical code examples for each topic.

Linuxbashcommand-line
0 likes · 37 min read
Essential Shell Commands and Scripting Techniques You Must Know
Nullbody Notes
Nullbody Notes
Dec 16, 2020 · Fundamentals

Understanding the Adapter Pattern in Go

The article explains the Adapter pattern by defining its purpose, illustrating the concept with mobile charging ports, and providing a complete Go code example that shows how to wrap incompatible interfaces so they can work together through adapters.

Adapter PatternCode ExampleDesign Patterns
0 likes · 3 min read
Understanding the Adapter Pattern in Go
Nullbody Notes
Nullbody Notes
Nov 26, 2020 · Fundamentals

Understanding Go Byte Order and Pointer Arithmetic in One Guide

This article demonstrates how to determine Go's endianness using unsafe.Pointer and uintptr, explains the memory layout of multi‑byte variables, and details the roles of *T, unsafe.Pointer, and uintptr for pointer arithmetic with concrete code examples.

Gobyte orderendianness
0 likes · 5 min read
Understanding Go Byte Order and Pointer Arithmetic in One Guide
Nullbody Notes
Nullbody Notes
Nov 25, 2020 · Fundamentals

Understanding Go Memory Alignment: A Complete Guide

This article explains Go’s type size specifications and alignment guarantees, demonstrates how to compute a struct’s memory footprint using unsafe.Sizeof and unsafe.Alignof, walks through concrete examples with structs T and R, and shows how field ordering affects actual memory usage.

Goalignofmemory alignment
0 likes · 12 min read
Understanding Go Memory Alignment: A Complete Guide
Nullbody Notes
Nullbody Notes
Nov 19, 2020 · Fundamentals

Understanding the Singleton Pattern in Go: Eager vs Lazy Implementations

The article explains Go's singleton pattern, detailing eager (init) and lazy implementations using sync.Mutex and sync.Once, provides full code examples, demonstrates that each accessor returns the same instance, and discusses trade‑offs between memory usage and performance.

ConcurrencyDesign PatternGo
0 likes · 5 min read
Understanding the Singleton Pattern in Go: Eager vs Lazy Implementations
Nullbody Notes
Nullbody Notes
Nov 18, 2020 · Fundamentals

Understanding the Prototype Pattern in Go: Clone Objects Efficiently

This article explains the Prototype design pattern in Go, shows how to clone objects with various implementations, compares their effects on object independence, and clarifies Go's value‑semantic parameter passing using concrete code examples and detailed analysis.

CloneDesign PatternsPrototype Pattern
0 likes · 8 min read
Understanding the Prototype Pattern in Go: Clone Objects Efficiently
Nullbody Notes
Nullbody Notes
Nov 15, 2020 · Fundamentals

Factory Method Pattern in Go: A Foodie's Take on Object Creation

This article walks through implementing Simple Factory and Factory Method patterns in Go, showing how to encapsulate object creation with a Food interface, concrete types, and factory structs, and explains the pointer vs value implementation rules and design‑principle benefits.

Dependency InversionDesign PatternsFactory Method
0 likes · 7 min read
Factory Method Pattern in Go: A Foodie's Take on Object Creation