Browsed by
Tag: golang

Methods in Golang

Methods in Golang

In Golang methods act on types. They are very similar to regular functions except that they take a receiver as a parameter. The receiver is the type which the method will be attached to. This will allow us to do something like myTypevar.doSomething(). For those coming from a language with classes and objects methods in Golang are similar to class member methods. As with regular functions you can pass the receiver by value or by reference. By convention a type’s…

Read More Read More