...

/

Methods Versus Functions

Methods Versus Functions

This lesson explains differences between a function and a method in Golang.

Differences between a function and a method

A function has the variable as a parameter:

Function1(recv)

A method is called on the variable:

recv.Method1()

A method can change the values (or the state) of the receiver variable provided this is ...