Creational Patterns
Patterns for object creation in Go, usually expressed through constructor functions, interfaces, and functional options.
5 published articles in this category
Abstract Factory in Go
Create related objects through one factory so whole product families can change together without leaking concrete types.
Builder in Go
Separate a multi-step construction workflow from the final representation so the same input can produce different outputs cleanly.
Factory Method in Go
Use constructor functions and small interfaces to select concrete implementations without coupling callers to them.
Prototype Pattern in Go
Clone preconfigured object graphs when copying is simpler or faster than rebuilding the same structure from scratch.
Singleton Pattern in Go
Use sync.Once carefully for one-time initialization, and understand when dependency injection is a better fit.