How do I exclude lines of code matching a pattern?

Hi, I would like to exclude lines of code matching a certain pattern in Golang, such as the following:

log.info(XXX, XXX…)

It is annoying that it is showing up as a code coverage issue. How can I turn this off? Thanks!

Hey there.

If you aren’t excluding entire files, your best bet is to find out the mechanism your coverage tool has to exclude certain types of code (manually or automatically) – SonarQube respects the information sent in the coverage report about what lines can be covered by tests (which lines are “executable”).