Hey! I am wondering where should I put my test doubles like Spy/Stub/Dummy implementations of specific interfaces. What do you think?
I'm of course asking about something that's aligned with go standard layout (internal, pkg directories etc).
In other programming languages I'm keeping these implementations in /test
directory with all tests, object-mothers, object-builders... but in Golang we're often keeping tests close to the production code.
What do you think? Have you're dealing with it? :)
Have a great week!
Top comments (1)
The canonical answer (as implemented in the standard library), is as follows: