From 4ac5c7b6ce9eb82fa8ca29cb0d5c696a446db9a7 Mon Sep 17 00:00:00 2001 From: Omid Hojabri Date: Sat, 18 Apr 2020 15:25:38 +0430 Subject: [PATCH 1/2] Correction of some typos --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 4a88f93..b317657 100644 --- a/main.go +++ b/main.go @@ -17,8 +17,8 @@ type Config struct { var ( numThreads = flag.Int("t", 1, "the numbers of threads used") method = flag.String("m", "GET", "the http request method") - requestBody = flag.String("b", "", "the http requst body") - requestBodyFile = flag.String("p", "", "the http requst body data file") + requestBody = flag.String("b", "", "the http request body") + requestBodyFile = flag.String("p", "", "the http request body data file") numConnections = flag.Int("c", 100, "the max numbers of connections used") totalCalls = flag.Int("n", 1000, "the total number of calls processed") disableKeepAlives = flag.Bool("k", true, "if keep-alives are disabled") @@ -26,7 +26,7 @@ var ( configFile = flag.String("f", "", "json config file") config Config target string - headers = flag.String("H", "User-Agent: go-wrk 0.1 bechmark\nContent-Type: text/html;", "the http headers sent separated by '\\n'") + headers = flag.String("H", "User-Agent: go-wrk 0.1 benchmark\nContent-Type: text/html;", "the http headers sent separated by '\\n'") certFile = flag.String("cert", "someCertFile", "A PEM eoncoded certificate file.") keyFile = flag.String("key", "someKeyFile", "A PEM encoded private key file.") caFile = flag.String("CA", "someCertCAFile", "A PEM eoncoded CA's certificate file.") From a46d5b97049cf2f10b3e60c112d99d714bc34c88 Mon Sep 17 00:00:00 2001 From: Omid Hojabri Date: Sat, 18 Apr 2020 17:04:00 +0430 Subject: [PATCH 2/2] Correction of some typos, print syntax if no args provided. --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index b317657..85680c8 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,7 @@ var ( caFile = flag.String("CA", "someCertCAFile", "A PEM eoncoded CA's certificate file.") insecure = flag.Bool("i", false, "TLS checks are disabled") respContains = flag.String("s", "", "if specified, it counts how often the searched string s is contained in the responses") + readAll = flag.Bool("r", false, "in the case of having stream or file in the response,\n it reads all response body to calculate the response size") ) func init() { @@ -77,6 +78,10 @@ func setRequestBody() { } func main() { + if len(os.Args) == 1 { //If no argument specified + flag.Usage() //Print usage + os.Exit(1) + } setRequestBody() switch *dist { case "m":