Re: [go-nuts] how to test main function coverage with different args

2019-04-24 Thread J. Santos
Hi, I think you could set the `os.Args` before calling your main. -- Jota On Tue, Apr 23, 2019, 6:03 AM hui zhang wrote: > how to test main function coverage with different args to enhance > coverage rate > how to cover the red part ? for you can set args once a time > > func Test_main(m

[go-nuts] how to test main function coverage with different args

2019-04-23 Thread hui zhang
how to test main function coverage with different args to enhance coverage rate how to cover the red part ? for you can set args once a time func Test_main(m *testing.T) { main2() } go test -coverprofile coverage.cov -args xxx.conf go tool cover -html=coverage.cov -o coverage.html --