From 520fca8ee51ef5e977d0b7e234336f40613d7c2b Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Thu, 3 Jan 2019 14:41:46 -0700 Subject: [PATCH] allow stdout pipe --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 93b6ba2..dafeefb 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "fmt" "io/ioutil" "net/http" + "os" "strings" "gitlab-app.eng.qops.net/golang/jwt" @@ -44,7 +45,7 @@ func main() { } if verbose { - fmt.Println(req) + fmt.Fprintf(os.Stderr, "%v\n", req) } resp, err := c.Do(req) if err != nil { @@ -56,7 +57,8 @@ func main() { } defer resp.Body.Close() - fmt.Printf("(%d) %s\n", resp.StatusCode, bytes.TrimSpace(b)) + fmt.Fprintf(os.Stderr, "(%d) ", resp.StatusCode) + fmt.Printf("%s\n", bytes.TrimSpace(b)) } func setJWT(r *http.Request, brandID string) {