Methods can also be defined on a non-struct custom type. Non-struct custom types can be created through type definition. Below is the format for creating a new custom type For example we…
Tag: method
Function/Method Overloading in Golang (Alternatives/Workaround)
Function/Method Overloading means that that the same function/method name can be used with a different number and types of parameters See this post for difference between function and method in Go –…
Difference between method and function in GO
There are some important differences between method and function. Let’s see the signature of both Function: Method: From the above signature, it is clear that method has a receiver argument. A receiver…
Template Method Design Pattern in Go (Golang)
Note: Interested in understanding how all other design patterns can be implemented in GO. Please see this full reference – All Design Patterns in Go (Golang) Introduction: Template Method Design Pattern is…