mardi 27 septembre 2016

Wrong test coverage in golang or what is the meaning of covered and tracked

I must be very dump, but I can't see my error. I've started a small golang application to test it out and learn some go. In my main package I have a main.go with for example a function called NewApp.

In my test file I've called it several times, but in the coverage its first line is marked as "not tracked". This function returns an App struct, but the whole struct definition is marked as "not tracked" to.

On the other hand I can't understand the difference between "not covered" and "not tracked". And is there a way to test the main function? I can't see the advantage of that.

My code is here: http://ift.tt/2d1yvDx

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire