Very, very, late response to this, but I was missing the `-coverpkg=./...` 
argument to `go test`. /facepalm

On Thursday, May 14, 2020 at 10:46:43 AM UTC+2 ppi...@gmail.com wrote:

> Not sure if a tool is required. 
> It can be done with a couple of commands. 
> An elaborate example (of coverage across different types of tests, etc) is 
> provided at: 
> https://www.elastic.co/blog/code-coverage-for-your-golang-system-tests
>
> On Thu, May 14, 2020 at 5:50 AM Tom Payne <twp...@gmail.com> wrote:
>
>> What's the current state of getting combined cross-package test coverage 
>> data? Specifically:
>>
>>    - I have a lib directory containing my library code, which has some 
>>    tests, but not many.
>>    - I have a cmd directory containing my main code and many tests that 
>>    exercises the code in lib .
>>    - I want to know what code in lib is covered by my tests in cmd (and, 
>>    more specifically, which code in lib is *not* covered by the tests so 
>>    I can add more tests).
>>
>> My current understanding is I need to use a third-party tool to merge 
>> coverage, like https://github.com/ory/go-acc.
>>
>> Is this correct?
>>
>> Many thanks,
>> Tom
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/3e24588a-005e-4072-80fe-ff7a912bd368%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/3e24588a-005e-4072-80fe-ff7a912bd368%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Pankaj Pipada
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/8774259b-71d3-40d7-88f5-9b510bb12ff6n%40googlegroups.com.

Reply via email to