From b46d215080e2c0aeceb3342e446992b194fc1b7f Mon Sep 17 00:00:00 2001 From: Oleg Iaremchuk Date: Mon, 11 Sep 2023 12:29:08 +0200 Subject: [PATCH] Fix linter issues --- cmd/api-template-go/main.go | 7 +++++-- internal/healthcheck/status.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/api-template-go/main.go b/cmd/api-template-go/main.go index 4285a69..a3d5d0d 100644 --- a/cmd/api-template-go/main.go +++ b/cmd/api-template-go/main.go @@ -40,9 +40,12 @@ func main() { log.Infof("web host is running at port: '%s'", configuration.Api.Port) lifecycle.ListenForApplicationShutDown(func() { + defer logger.Dispose() log.Info("terminating the web host") - host.Terminate(context) + if err := host.Terminate(context); err != nil { + log.Error("error terminating the host: '%v'", err) + } + log.Info("disposing logger") - logger.Dispose() }, make(chan os.Signal, 1)) } diff --git a/internal/healthcheck/status.go b/internal/healthcheck/status.go index 05f767b..82641c2 100644 --- a/internal/healthcheck/status.go +++ b/internal/healthcheck/status.go @@ -13,5 +13,5 @@ import ( func GetStatus(responseWriter http.ResponseWriter, request *http.Request) { responseWriter.WriteHeader(http.StatusOK) statusResponse := "healthy" - responseWriter.Write([]byte(statusResponse)) + _, _ = responseWriter.Write([]byte(statusResponse)) }