30 days of code in Go: Day 4 - Class vs Instance
Here I am again for the 30 Days of Code in Go. This is Saturday, but that doesn’t mean I will not code =). First of all, before starting to code I was thinking about the theme: classes. I was wondering if Go had support for it and I found some interesting material to read. First I read Why Go’s structs are superior to class-based inheritance and I found out the the inheritance model of Go is different from that of Java. Basically, you do not actually specify which class implements an interface, but the compiler. A class can implement several interfaces, not being limited to one super-class like in Java or C++. Another materials I read were Go by Example Structs, methods and interfaces. I am not so well versed on the syntax, but it is not hard to grasp it and start coding. Nevertheless, HackerRank was good to me and gave some starter code and I just implemented the methods. ...