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)) }