Home

Awesome

Go Patterns

This repository acts as a list of demos for desirable design patterns in the Go language. Click the pattern name below to go to each example.

PatternDescription
CallbackPassing functions as parameters to other functions.
ContextCancelling execution across module boundaries.
Dependency injectionProviding dependencies of code as a parameter.
EmbeddingEmbedding static files into the Go binary.
ErrorsHandling typed errors in Go.
Limited queueCreating queues with limited parallel execution.
Multi-waitCreating a signal multiple components can wait for in parallel.
OOPObject-oriented programming in Go.
RetriesRetrying a failed action in Go.
SafeMaking sure panics don't crash the program.

License

This repository is licensed under the MIT-0 license. You are welcome to take it and use it in your own coding standards with no attribution required.

Contributing

Contributions to this repository are welcome! Please be prepared to submit your code under the MIT-0 license.

When writing the code please keep in mind that this repository is meant as a helper for beginners. Examples should be simplified and commented ubiquitously.