Download go eBook


Structs are sets of various variables packed together. The struct itself is only a package containing variables and making them easily accessible.

Unlike in C, Go's structs can have methods attached to them. It also allows them to implement interfaces. That makes Go's structs similar to objects, but they are (probably intentionally) missing some major features known in object oriented languages like inheritance.

Related Examples


797 Contributors: 25
Tuesday, March 7, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial:

Download eBook