fix: resolve noinlineerr lint issues

This commit is contained in:
user
2026-02-20 03:17:09 -08:00
parent f125a3f591
commit 3d968a1102
3 changed files with 28 additions and 11 deletions

View File

@@ -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)