Adapter/Wrapper
A pattern that allows incompatible interfaces to work together by wrapping one interface to match another.
Explore 12 Go patterns from the community
12 patterns found
A pattern that allows incompatible interfaces to work together by wrapping one interface to match another.
A pattern for grouping related configuration options into a struct for cleaner function signatures.
A pattern for passing request-scoped values, cancellation signals, and deadlines through the call chain.
A pattern where an object's dependencies are provided by an external entity rather than created by the object itself.
A pattern for adding context to errors while preserving the original error for inspection.
A pattern for clean, extensible API design using variadic functions for optional configuration.
Cleanly shut down servers and background workers by listening for signals and using context cancellation.
Watch configuration files for changes and reload application settings without restarting.
A pattern for controlling the rate at which operations are performed to prevent resource exhaustion.
Ensure a single instance of a type exists using sync.Once for thread-safe lazy initialization.
A testing pattern that defines test cases as data in a table, enabling comprehensive and maintainable test coverage.
A concurrency pattern that limits parallelism by distributing work across a fixed number of goroutines.