Back to Blog
GoGolang

In the Realm of Go

Tijani Eneye

Tijani Eneye

May 22, 2025

In the Realm of Go

Object-oriented programming is one of the beauties of programming. The way it handles objects is synonymous with what happens in real life, encompassing concepts such as Inheritance, Abstraction, and Polymorphism. While class-based OOP languages like PHP, Java, and others manage inheritance through class extension (from parent to children), Go handles this with the help of type struct, which helps to group properties and methods of the likes, it didn’t stop there, it also use "Type Struct Embedding” which allows a type structure in Go to embed another structure inside it, making the methods and properties of the struct accessible in another struct, more like what we do with “extends” in PHP.

While Languages like PHP, Java, and the like capitalize on the class to group properties and methods alike, Go do this with the help of “Type Struct”, it also imitates inheritance using the “Type Struct Embedding” to open the properties and methods of one type to another.