News for hackers. Stuff that matters.
Re:How to Use Go Interfaces by JepZ on Tuesday March 20, 2018 @07:12AM (#16627493)
Well, it might be that I was doing something wrong, but in the end I didn't have circular dependencies anymore, so I was doing right again? (just kidding) ;-)

So in fact, I don't like to have circular dependencies in Go either and try to avoid them, so I agree with you on that. But at the same time I like very small and simple packages and sometimes you have to choose:

1. do you build a larger package with everything inside

2. do you build multiple smaller packages with dependencies on each other

As I said, in general, I favor the smaller packages and that can lead to circular dependencies, if you are not using interfaces properly.

Re:How to Use Go Interfaces by fiatjaf on Tuesday March 20, 2018 @08:42AM (#16627995)
Ok, you have a point.

But I still think that you have multiple packages and each one is calling all the other ones, then it doesn't make much sense to have multiple packages at all.

I prefer smaller packages too, but currently I'm trying to avoid overmodularizing, specially when a package is too connected to some others and is not going to be used elsewhere.