From cf8c5150114a94c54fe1343e6886077551a2d678 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Thu, 20 Jul 2017 11:27:27 -0700 Subject: [PATCH] gixcup etcdmain cov --- etcdmain/main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/etcdmain/main.go b/etcdmain/main.go index e8450a8d6933..06bbae56b8d1 100644 --- a/etcdmain/main.go +++ b/etcdmain/main.go @@ -27,10 +27,13 @@ func Main() { checkSupportArch() if len(os.Args) > 1 { - if len(os.Getenv("ETCDCOV_ARGS")) > 0 { - rootCmd.SetArgs(strings.Split(os.Getenv("ETCDCOV_ARGS"), "\xe7\xcd")[1:]) + cmd := os.Args[1] + if covArgs := os.Getenv("ETCDCOV_ARGS"); len(covArgs) > 0 { + args := strings.Split(os.Getenv("ETCDCOV_ARGS"), "\xe7\xcd")[1:] + rootCmd.SetArgs(args) + cmd = "grpc-proxy" } - switch os.Args[1] { + switch cmd { case "gateway", "grpc-proxy": if err := rootCmd.Execute(); err != nil { fmt.Fprint(os.Stderr, err)