GO and OOP

Jimmy (xiaoke) Shen
1 min readAug 21, 2020

Firstly, read the following article.

Whats the difference of functions and methods in Go?

The term “method” came up with object-oriented programming. In an OOP language (like C++ for example) you can define a “class” which encapsulates data and functions which belong together. Those functions inside a class are called “methods” and you need an instance of that class to call such a method.

In Go, the terminology is basically the same, although Go isn’t an OOP language in the classical meaning. In Go, a function which takes a receiver is usually called a method (probably just because people are still used to the terminology of OOP). — From the link above.

--

--