From 9df9a50a1a388def4eb75cf0bcced74ee00a0f0c Mon Sep 17 00:00:00 2001 From: user Date: Sun, 26 Aug 2018 14:19:23 +0100 Subject: [PATCH] Linting --- .../matrix-org/dendrite/appservice/query/query.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/appservice/query/query.go b/src/github.com/matrix-org/dendrite/appservice/query/query.go index 681b7730..81da361d 100644 --- a/src/github.com/matrix-org/dendrite/appservice/query/query.go +++ b/src/github.com/matrix-org/dendrite/appservice/query/query.go @@ -86,15 +86,7 @@ func (a *AppServiceQueryAPI) RoomAliasExists( req = req.WithContext(ctx) resp, err := a.HTTPClient.Do(req) if resp != nil { - defer func() { - err = resp.Body.Close() - if err != nil { - log.WithFields(log.Fields{ - "appservice_id": appservice.ID, - "status_code": resp.StatusCode, - }).WithError(err).Error("Unable to close application service response body") - } - }() + defer resp.Body.Close() // nolint: errcheck } if err != nil { log.WithError(err).Errorf("Issue querying room alias on application service %s", appservice.ID) @@ -141,6 +133,10 @@ func (a *AppServiceQueryAPI) UserIDExists( if appservice.URL != "" && appservice.IsInterestedInUserID(request.UserID) { // The full path to the rooms API, includes hs token URL, err := url.Parse(appservice.URL + userIDExistsPath) + if err != nil { + return err + } + URL.Path += request.UserID apiURL := URL.String() + "?access_token=" + appservice.HSToken