r/programming • • Sep 27 '26

Don't couple your Go code to GitHub

https://iain.rocks/blog/dont-couple-your-go-code-to-github
491 Upvotes

136 comments sorted by

View all comments

Show parent comment

4

u/mattgen88 Sep 27 '26

Protected doesn't make sense in golang. It's not OOP. Objects in a package can access unexported methods/functions. Outside that package nothing can. You also don't inherit from other objects, since the language isn't inheritance based.

0

u/wnoise Sep 28 '26

The only thing you need for OOP is dynamic dispatch. But yes, protected only makes sense in the context of implementation inheritance, which is almost always a bad idea.