Discover Packages
github.com/spiiderdan/design-patterns-in-go
command
module
Version:
v0.0.0-...-c79cdc0
Opens a new window with list of versions in this module.
Published: May 13, 2025
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
ΒΆ
Design Patterns in Go π§
This repository contains examples of classic software design patterns implemented in Go, organized by category.
Each pattern includes:
A clear, commented Go implementation
A simple real-world analogy
When to use it (and when not to)
π¦ Categories
Creational
Singleton β Ensures only one instance is used (e.g., Redis connection)
Factory Method β Powers a URL shortener that selects between random and hash-based generation strategies
Builder
Structural
Behavioral
π§βπ» Why this project?
I'm learning and practicing design patterns by building them one by one in Go β this is both a personal learning log and a portfolio project. Each pattern is paired with a small real-world example to make it easier to understand and apply.
π Language
π© Contributions
Feel free to fork, star, or open an issue with ideas or suggestions!
Expand βΎ
Collapse β΄
Documentation
ΒΆ
There is no documentation for this package.
Source Files
ΒΆ
Directories
ΒΆ
creational
Click to show internal directories.
Click to hide internal directories.