Hacker News new | ask | show | jobs
by brianvoe 1357 days ago
Thanks for the reply. Do you feel this way too if external repos need this data as well? I advocated for the use of interfaces for these external packages to keep them self contained an not reliant on an external structs package for a few simple fields.
1 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.