Design Patterns in Golang: Prototype

Preface The Prototype Pattern creates duplicate objects while keeping performance in mind. It’s a part of the creational patterns and provides one of the best ways to create an object. In the mainstream languages (like C# and JAVA), it requires implementing a prototype interface which tells to create a clone of the current object. It is used when creation of object directly is costly. For instance, an object is to be created after a costly database operation.