Glossary: Software Design Patterns in Go
Factory method
A pattern where the code that uses a part lets something else decide which object to make. Because Go has no subclasses, a function field plays that role, as in `Shipment{makeCarrier: ...}`.
Glossary: Software Design Patterns in Go
A pattern where the code that uses a part lets something else decide which object to make. Because Go has no subclasses, a function field plays that role, as in `Shipment{makeCarrier: ...}`.