From b545eac5a811b0062f1ff411c55bf5de8b5d93c8 Mon Sep 17 00:00:00 2001 From: Max Lerebourg Date: Thu, 29 Sep 2022 14:01:33 +0200 Subject: [PATCH] fix lint --- bouncer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bouncer.go b/bouncer.go index ce744a6..b10a2b1 100644 --- a/bouncer.go +++ b/bouncer.go @@ -304,7 +304,7 @@ func handleStreamCache(a *Bouncer, initialized bool) { a.crowdsecStreamHealthy = true } -func crowdsecQuery(a *Bouncer, stringURL string) ([]byte) { +func crowdsecQuery(a *Bouncer, stringURL string) []byte { req, _ := http.NewRequest(http.MethodGet, stringURL, nil) req.Header.Add(crowdsecAuthHeader, a.crowdsecKey) res, err := a.client.Do(req) @@ -318,7 +318,7 @@ func crowdsecQuery(a *Bouncer, stringURL string) ([]byte) { a.crowdsecStreamHealthy = false return nil } - defer func (body io.ReadCloser) { + defer func(body io.ReadCloser) { err = body.Close() if err != nil { log.Printf("failed to close body reader: %s", err) @@ -332,4 +332,3 @@ func crowdsecQuery(a *Bouncer, stringURL string) ([]byte) { } return body } -