Re:Practical Go: Real-world advice for writing maintainable ...
by kazagistar on Friday February 22, 2019 @10:52AM
(#19226309)
Make private functions that are only visible to the current module. Then write your unit tests directly in that same module, next to the functions, so they can access them even when the rest of the world cannot. Of course, this requires sensible language support.
[ Parent
| on HN ]
Re:Practical Go: Real-world advice for writing maintainable ...
by Roboprog on Friday February 22, 2019 @09:39PM
(#19231247)
Hierarchy vs list. I don’t want a list (of subroutines). I want a tree of self contained routines. Only your containing routine uses you. Which “private“ routines use which? (I know the IDE will tell me about this routine, and that routine, but I don’t want to have to ask)
Your employer doesn’t want you testing getters, anyway, but rather features. Unit test fanatics need to stop.
I guess unit tests were useful for C++, when it was constantly crashing everything :-(
C++ and its legacy need to ride off into the sunset, already.