Hacker News new | past | comments | ask | show | jobs | submit login

I know you can, i've explicitly talked about struct inheritance in my comment, as well as manually defining functions for the new type. Yet, this is a weird construct if all you want to do is class inheritance. You have to deal with questions like "do i want to define the func on my type, or on a pointer to that type", or "how do i call "super"", how do i extend the constructor for that new type, etc..

All those questions do have answers in golang. But you have to learn new patterns in order to do an extremely basic and common thing in OOP, once again, without much immediate apparent benefit.




> i've explicitly talked about struct inheritance in my comment

It's not struct inheritance[1], so I wasn't sure what you were talking about.

[1] - http://golang.org/ref/spec#Struct_types




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: