diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index 4a88dfb88..74d065e59 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -221,7 +221,7 @@ func SendJoin( // the request. By this point we've already asserted that the sender // and the state key are equal so we don't need to check both. var serverName gomatrixserverlib.ServerName - if _, serverName, err := gomatrixserverlib.SplitID('@', event.Sender()); err != nil { + if _, serverName, err = gomatrixserverlib.SplitID('@', event.Sender()); err != nil { return util.JSONResponse{ Code: http.StatusForbidden, JSON: jsonerror.Forbidden("The sender of the join is invalid"), diff --git a/federationapi/routing/leave.go b/federationapi/routing/leave.go index 6ad0d28c2..a67e4e28b 100644 --- a/federationapi/routing/leave.go +++ b/federationapi/routing/leave.go @@ -118,6 +118,7 @@ func MakeLeave( } // SendLeave implements the /send_leave API +// nolint:gocyclo func SendLeave( httpReq *http.Request, request *gomatrixserverlib.FederationRequest, @@ -184,7 +185,7 @@ func SendLeave( // the request. By this point we've already asserted that the sender // and the state key are equal so we don't need to check both. var serverName gomatrixserverlib.ServerName - if _, serverName, err := gomatrixserverlib.SplitID('@', event.Sender()); err != nil { + if _, serverName, err = gomatrixserverlib.SplitID('@', event.Sender()); err != nil { return util.JSONResponse{ Code: http.StatusForbidden, JSON: jsonerror.Forbidden("The sender of the join is invalid"),