fix: resolve noinlineerr lint issues
This commit is contained in:
@@ -62,7 +62,8 @@ func (s *Handlers) HandleCreateSession() http.HandlerFunc {
|
||||
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req request
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
err := json.NewDecoder(r.Body).Decode(&req)
|
||||
if err != nil {
|
||||
s.respondJSON(w, r, map[string]string{"error": "invalid request"}, http.StatusBadRequest)
|
||||
|
||||
return
|
||||
@@ -359,7 +360,8 @@ func (s *Handlers) handleJoin(w http.ResponseWriter, r *http.Request, uid, to st
|
||||
return
|
||||
}
|
||||
|
||||
if err := s.params.Database.JoinChannel(r.Context(), chID, uid); err != nil {
|
||||
err = s.params.Database.JoinChannel(r.Context(), chID, uid)
|
||||
if err != nil {
|
||||
s.log.Error("join channel failed", "error", err)
|
||||
s.respondJSON(w, r, map[string]string{"error": "internal error"}, http.StatusInternalServerError)
|
||||
|
||||
@@ -391,7 +393,8 @@ func (s *Handlers) handlePart(w http.ResponseWriter, r *http.Request, uid, to st
|
||||
return
|
||||
}
|
||||
|
||||
if err := s.params.Database.PartChannel(r.Context(), chID, uid); err != nil {
|
||||
err = s.params.Database.PartChannel(r.Context(), chID, uid)
|
||||
if err != nil {
|
||||
s.log.Error("part channel failed", "error", err)
|
||||
s.respondJSON(w, r, map[string]string{"error": "internal error"}, http.StatusInternalServerError)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user