diff --git a/app/http/middleware/auth.go b/app/http/middleware/auth.go index 37c0a00..71d17ae 100644 --- a/app/http/middleware/auth.go +++ b/app/http/middleware/auth.go @@ -17,7 +17,7 @@ func Auth() http.Middleware { token := ctx.Request().Header("Authorization", "") if token == "" { - ctx.Response().String(http.StatusUnauthorized, "Unauthorized").Abort() + _ = ctx.Response().String(http.StatusUnauthorized, "Unauthorized").Abort() return } diff --git a/main.go b/main.go index 3fb91b6..8992ae3 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,7 @@ func main() { bootstrap.Boot() // Create a channel to listen for OS signals - quit := make(chan os.Signal) + quit := make(chan os.Signal, 1) signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) // Start http server by facades.Route(). diff --git a/routes/test.go b/routes/test.go index 00704c8..dc8284a 100644 --- a/routes/test.go +++ b/routes/test.go @@ -46,7 +46,11 @@ func Test() { } var query Query - ctx.Request().BindQuery(&query) + if err := ctx.Request().BindQuery(&query); err != nil { + return ctx.Response().Json(http.StatusBadRequest, http.Json{ + "error": err.Error(), + }) + } return ctx.Response().Json(http.StatusOK, http.Json{ "name": query.Name, diff --git a/tests/services/main_test.go b/tests/services/main_test.go index e1ab8d5..4934897 100644 --- a/tests/services/main_test.go +++ b/tests/services/main_test.go @@ -14,5 +14,5 @@ func TestMain(m *testing.M) { m.Run() - file.Remove("goravel") + _ = file.Remove("goravel") }