From 3f30ea134bf2ac44d0feafaebfaf3525b523bfa9 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 25 Feb 2021 15:53:46 +0100 Subject: [PATCH] resolve linter issues --- graph/go.sum | 1 + graph/pkg/server/debug/server.go | 8 ++++++-- graph/pkg/server/http/server.go | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/graph/go.sum b/graph/go.sum index a37d78718..d318245b0 100644 --- a/graph/go.sum +++ b/graph/go.sum @@ -1761,6 +1761,7 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2m golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b h1:lAZ0/chPUDWwjqosYR0X4M490zQhMsiJ4K3DbA7o+3g= golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= diff --git a/graph/pkg/server/debug/server.go b/graph/pkg/server/debug/server.go index d7b083e7e..80bfd80fb 100644 --- a/graph/pkg/server/debug/server.go +++ b/graph/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/graph/pkg/server/http/server.go b/graph/pkg/server/http/server.go index 916a6b8fc..358dc5138 100644 --- a/graph/pkg/server/http/server.go +++ b/graph/pkg/server/http/server.go @@ -54,7 +54,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