Skip to content

Comment on Golang – Pull all the structs out???parent

Comments

Absolutely, having very focused packages helps from an external consumer perspective as well.

Interfaces can help if you have multiple things that all implement the same functionality or you need to mock out for testing, but often times people will create interface bloat for things that are only implemented by a single struct and there’s no benefit to testing.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.