go-design-patterns

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 0 Imported by: 0

README

Go Design Patterns

This repository is my own implementation of the classic Design Patterns in Go language, introduced in the famous book 'Design Patterns: Elements of Reusable Object-Oriented Software' written by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides.

Each example is heavily commented and I've tried to come up with the interesting and unique application area for every pattern to make it interesting for the reader.

Each package demonstrates one pattern and includes a Run() function to execute a sample.

Patterns Implemented

Creational
Structural
Behavioral
Tactical

Running

git clone https://github.com/ViXP/go-design-patterns
cd go-design-patterns
go run .

Please, uncomment the lines in main.go file to execute the example of the specific design pattern you like.

Documentation

Full GoDoc available at: https://pkg.go.dev/github.com/ViXP/go-design-patterns

License

MIT License © ViXP

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package adapter implements the Adapter design pattern.
Package adapter implements the Adapter design pattern.
Package bridge implements the Bridge design pattern.
Package bridge implements the Bridge design pattern.
Package builder implements the Builder design pattern.
Package builder implements the Builder design pattern.
Package chain_of_responsibility implements the Chain Of Responsibility design pattern.
Package chain_of_responsibility implements the Chain Of Responsibility design pattern.
Package command implements the Command design pattern.
Package command implements the Command design pattern.
Package composite implements the Composite design pattern.
Package composite implements the Composite design pattern.
Package decorator implements the Decorator design pattern.
Package decorator implements the Decorator design pattern.
Package facade implements the Facade design pattern.
Package facade implements the Facade design pattern.
Package factory implements the Factory and Abstract Factory design pattern.
Package factory implements the Factory and Abstract Factory design pattern.
Package flyweight implement the Flyweight design pattern.
Package flyweight implement the Flyweight design pattern.
Package interpreter implement the Interpreter design pattern.
Package interpreter implement the Interpreter design pattern.
Package iterator implements the Iterator design pattern.
Package iterator implements the Iterator design pattern.
Package mediator implements the Mediator design pattern.
Package mediator implements the Mediator design pattern.
Package memento implements the Memento design pattern.
Package memento implements the Memento design pattern.
Package observer implements the Observer design pattern.
Package observer implements the Observer design pattern.
Package prototype implements the Prototype design pattern.
Package prototype implements the Prototype design pattern.
Package proxy implements the Proxy design pattern.
Package proxy implements the Proxy design pattern.
Package singleton implements the Singleton design pattern.
Package singleton implements the Singleton design pattern.
Package specification implements Specification tactical pattern.
Package specification implements Specification tactical pattern.
Package state implements the State design pattern.
Package state implements the State design pattern.
Package strategy implements the Strategy design pattern.
Package strategy implements the Strategy design pattern.
Package template_method implements the Template Method design pattern.
Package template_method implements the Template Method design pattern.
Package visitor implements the Visitor design pattern.
Package visitor implements the Visitor design pattern.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL