5 ms·
Can you give us an example of where it doesn't make sense?
by lowbloodsugar 6y ago
Can you give us an example of where it doesn't make sense?
- GordonS 6y agoA trivial example would be getters and setters for plain old classes.
- lowbloodsugar 6y agoSurely the getters and setters of POJOs would be exercised in the tests of other classes? If not, why are they there?
- dropofwill 6y agoE.g. it’s public api in a library and they’re only used by other applications.
- closeparen 6y agoIn Go, it turns testing into a game of “how do I make this stdlib function return an error”?
- noisem4ker 6y agoError handling taking up 50% of the code is definitely a problem with Go itself. For each meaningful line, there's an accompanying "if err != nil {return err}", so if you want coverage you end up testing this kind of boilerplate.