print summary message only when verbose flag is set (#19)

This commit is contained in:
Joshua Humphries 2018-03-13 16:49:09 -04:00 committed by GitHub
parent f7eb17819d
commit 585cd1bae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -386,7 +386,9 @@ func main() {
if h.respCount != 1 { if h.respCount != 1 {
respSuffix = "s" respSuffix = "s"
} }
if *verbose {
fmt.Printf("Sent %d request%s and received %d response%s\n", h.reqCount, reqSuffix, h.respCount, respSuffix) fmt.Printf("Sent %d request%s and received %d response%s\n", h.reqCount, reqSuffix, h.respCount, respSuffix)
}
if h.stat.Code() != codes.OK { if h.stat.Code() != codes.OK {
fmt.Fprintf(os.Stderr, "ERROR:\n Code: %s\n Message: %s\n", h.stat.Code().String(), h.stat.Message()) fmt.Fprintf(os.Stderr, "ERROR:\n Code: %s\n Message: %s\n", h.stat.Code().String(), h.stat.Message())
exit(1) exit(1)