From 1f5f99996b8d5a25ebbfc9b0c20caed8ebf0a640 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 25 Feb 2021 10:34:12 +0100 Subject: [PATCH] resolve linter issues --- onlyoffice/pkg/server/debug/server.go | 8 ++++++-- onlyoffice/pkg/server/http/server.go | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/onlyoffice/pkg/server/debug/server.go b/onlyoffice/pkg/server/debug/server.go index eeabac7024..881f835b70 100644 --- a/onlyoffice/pkg/server/debug/server.go +++ b/onlyoffice/pkg/server/debug/server.go @@ -34,7 +34,9 @@ func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { // TODO(tboerger): check if services are up and running - io.WriteString(w, http.StatusText(http.StatusOK)) + if _, err := io.WriteString(w, http.StatusText(http.StatusOK)); err != nil { + panic(err) + } } } @@ -46,6 +48,8 @@ func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { // TODO(tboerger): check if services are up and running - io.WriteString(w, http.StatusText(http.StatusOK)) + if _, err := io.WriteString(w, http.StatusText(http.StatusOK)); err != nil { + panic(err) + } } } diff --git a/onlyoffice/pkg/server/http/server.go b/onlyoffice/pkg/server/http/server.go index f69dbfef39..244b1e9177 100644 --- a/onlyoffice/pkg/server/http/server.go +++ b/onlyoffice/pkg/server/http/server.go @@ -56,7 +56,9 @@ func Server(opts ...Option) (http.Service, error) { handle = svc.NewTracing(handle) } - micro.RegisterHandler(service.Server(), handle) + if err := micro.RegisterHandler(service.Server(), handle); err != nil { + return http.Service{}, err + } service.Init() return service, nil