From 6cbe4e9f08a01869d5bb2e273fb56e71f41eb03a Mon Sep 17 00:00:00 2001 From: vitalyliber Date: Sat, 8 Dec 2018 15:55:17 +0300 Subject: [PATCH 1/2] fixed --- main.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index d0c8635..0652e68 100644 --- a/main.go +++ b/main.go @@ -36,16 +36,24 @@ func main() { func storm(url string) { for { - log.Println("Start attack to url:", url) + log.Println("Start load test on the url:", url) resp, err := http.Get(url) if err != nil { - log.Println("Got error code from site:", resp.Status) + log.Println("Got error code from url:", resp.Status) return } else { - log.Println("Success attack:", resp.Status) + log.Println("Load test passed successfuly:", resp.Status) } - defer resp.Body.Close() + + defer func() { + err := resp.Body.Close() + if err != nil { + log.Println("Error while closing connection", err) + } + return + }() + counter += 1 - log.Println("Number of attack:", counter) + log.Println("Number of successful test:", counter) } } From ebc8b50d14fccc4888a6aefe3a82124ea6ece8dc Mon Sep 17 00:00:00 2001 From: vitalyliber Date: Sat, 8 Dec 2018 15:59:24 +0300 Subject: [PATCH 2/2] download instructions for linux and macos was added --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 76e87a1..79dc6e6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,20 @@ Minimalistic performance and load testing tool written in Go. ## How to use gostorm? -- Build or download version for your OS +- Download and install to MacOS + +``` +curl -L https://github.com/vitalyliber/gostorm/releases/download/v.1.0.1/gostorm_macos -o /usr/local/bin/gostorm +sudo chmod a+x /usr/local/bin/gostorm +``` + +- Download and install to Linux + + +``` +curl -L https://github.com/vitalyliber/gostorm/releases/download/v.1.0.1/gostorm_linux -o /usr/local/bin/gostorm +sudo chmod a+x /usr/local/bin/gostorm +``` - Run and paste url: ```bash @@ -36,4 +49,4 @@ Windows ```bash GOOS=windows GOARCH=amd64 go build -o gostorm_windows -``` +``` \ No newline at end of file