From 43ad535543e40e01bb3819b913486bfe6eb8a01a Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Fri, 12 Apr 2024 13:59:25 +0200 Subject: [PATCH] accurate and necessary logging only --- main.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index 01e425a..b1ae262 100644 --- a/main.go +++ b/main.go @@ -145,9 +145,6 @@ func sendRequest(client *resty.Client, url string, ins []interface{}) { return } - // Debug log json data - log.Printf("Request: %s\n", string(marshal)) - // Create instructions form data req, content := createInsructions(marshal) if req == nil { @@ -166,9 +163,6 @@ func sendRequest(client *resty.Client, url string, ins []interface{}) { return } - // Print response status - log.Printf("Response Status: %s\n", res.Status()) - // Unmarshal response var data Response err = json.Unmarshal(res.Body(), &data) @@ -178,7 +172,9 @@ func sendRequest(client *resty.Client, url string, ins []interface{}) { } // Print response - log.Printf("Success: %t\n", data.Success) + if !data.Success { + log.Fatal(errors.New("Remote server responded unsuccessfully!")) + } } func main() {