Factory Pattern in Go: Creating Objects with Factories
Factory Pattern solves one problem: how to create objects without being tied to concrete types. Instead of directly calling a constructor, use a factory function that decides which object to create.