From afa9f82e7d9df0d4b42deb3e6f2708b6b9bdafd1 Mon Sep 17 00:00:00 2001 From: "shruti.wadnerkar" Date: Fri, 4 Oct 2019 16:55:23 +0530 Subject: [PATCH] helperController-optimization --- controllers/helperController.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/helperController.go b/controllers/helperController.go index 0b6e53d..177a6f6 100644 --- a/controllers/helperController.go +++ b/controllers/helperController.go @@ -23,18 +23,19 @@ func getConnectionUrl() string { return "http://go-neo-experiment:gn4xperiment@localhost:7474" } func parseJsonInterests(c echo.Context) (Model.UserInterest, bool) { + res := false methodSource := " MethodSource : parseJsonInterests." s, errRead := ioutil.ReadAll(c.Request().Body) if errRead != nil { logMessage(methodSource + "Error while reading from request.Desc: " + errRead.Error()) - return Model.UserInterest{}, false + return Model.UserInterest{}, res } jsonBody := new(Model.UserInterest) errParse := json.Unmarshal([]byte(s), jsonBody) if errParse != nil { logMessage(methodSource + "Error while Parsing to Interest Json. Desc: " + errParse.Error()) - return *jsonBody, false + return *jsonBody, res } return *jsonBody, true }