diff --git a/main.go b/main.go index 52433006..406c1c74 100644 --- a/main.go +++ b/main.go @@ -191,13 +191,6 @@ func runAudit(c conf.Configuration, outputFile string, outputURL string) { panic(err) } - if outputFile != "" { - err := ioutil.WriteFile(outputFile, []byte(jsonData), 0644) - if err != nil { - panic(err) - } - } - if outputURL != "" { req, err := http.NewRequest("POST", outputURL, bytes.NewBuffer(jsonData)) req.Header.Set("Content-Type", "application/json") @@ -216,5 +209,12 @@ func runAudit(c conf.Configuration, outputFile string, outputURL string) { glog.Println(string(body)) } } + + if outputFile != "" { + err := ioutil.WriteFile(outputFile, []byte(jsonData), 0644) + if err != nil { + panic(err) + } + } } }