As mentioned by @Flimzy, this is not supported with the built-in tool.
Though, looking at the coverage.html
file output by the cover
tool.
You can do something like this:
go tool cover -o coverage.html -html=coverage.out; sed -i 's/black/whitesmoke/g' coverage.html; sensible-browser coverage.html
which will write the output to coverage.html
using the -o
flag and then use sed
to change occurrences of black to whitesmoke. It will then use your default browser to open the file.
Note #1: Obviously, this will not work once the tool is updated not to output black color background. Though, if this changes, there is probably a lot better support for different color schemes.
Note #2: If you use heat maps -covermode=count
, the light green might look awkward on the smokewhite color. Feel free to try different color accents though.
go fmt
,go imports
, etc...) is not OK here, because it is not strictly related to programming? – Keffiyeh