News for hackers. Stuff that matters.
Re:Go 1.11 got me to stop ignoring Go by thanatos_dem on Tuesday October 09, 2018 @03:58PM (#18179329)
If you have your tests within the same package, they can access the private members of structs directly, which helps avoid some of the mess.

If you’re in a different package things aren’t too bad if you have meaningfully abstracted interfaces. And with Go’s duck typing, even if you’re using another package that doesn’t have good abstraction, you can create your own interfaces with the functionality you need for mocking purposes.

There are no comments on this comment yet.