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
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
--