From 4460d6a7b71570849dba507190e5575748977667 Mon Sep 17 00:00:00 2001 From: hackerman <3372410+aeneasr@users.noreply.github.com> Date: Mon, 8 Jun 2020 17:53:48 +0200 Subject: [PATCH] fix: fix syntax error (#19) Closes #18 --- cmd/root.go | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 7a0aa51..f083105 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -134,15 +134,15 @@ GO_TEST_BINARY="gotest" stderr, err := c.StderrPipe() if err != nil { - fatalf("%s", err) + return err } stdout, err := c.StdoutPipe() if err != nil { - fatalf("%s", err) + return err } if err := c.Start(); err != nil { - fatalf("%s", err) + return err } var wg sync.WaitGroup @@ -151,7 +151,7 @@ GO_TEST_BINARY="gotest" go scan(&wg, stdout) if err := c.Wait(); err != nil { - fatalf("%s", err) + return err } wg.Wait() @@ -164,7 +164,7 @@ GO_TEST_BINARY="gotest" p, err := ioutil.ReadFile(file) if err != nil { - fatalf("%s", err) + return err } ps := strings.Split(string(p), "\n") @@ -173,12 +173,10 @@ GO_TEST_BINARY="gotest" output, err := cmd.Flags().GetString("output") if err != nil { - fatalf("%s", err) + return err } - if err := ioutil.WriteFile(output, []byte(payload), 0644); err != nil { - fatalf("%s", err) - } + return ioutil.WriteFile(output, []byte(payload), 0644) }, } @@ -218,12 +216,6 @@ func initConfig() { } -func fatalf(msg string, args ...interface{}) { - fmt.Printf(msg, args...) - fmt.Println("") - os.Exit(1) -} - type filter struct { dtl io.Writer }