fix: resolve wsl_v5, lll, noinlineerr, and gosec lint issues

This commit is contained in:
user
2026-02-20 03:26:06 -08:00
parent db3b0bfee1
commit e0da78f17c
4 changed files with 14 additions and 4 deletions

View File

@@ -64,6 +64,7 @@ func (s *Handlers) HandleCreateSession() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req request
err := json.NewDecoder(r.Body).Decode(&req)
if err != nil {
s.respondJSON(w, r, map[string]string{"error": "invalid request"}, http.StatusBadRequest)
@@ -166,6 +167,7 @@ func (s *Handlers) HandleChannelMembers() http.HandlerFunc {
var chID string
//nolint:gosec // G701: parameterized query with ? placeholder, not injection
err := s.params.Database.GetDB().QueryRowContext(r.Context(),
"SELECT id FROM channels WHERE name = ?", name).Scan(&chID)
if err != nil {
@@ -304,6 +306,7 @@ func (s *Handlers) handlePrivmsg(w http.ResponseWriter, r *http.Request, uid, ni
// Channel message.
var chID string
//nolint:gosec // G701: parameterized query, not injection
err := s.params.Database.GetDB().QueryRowContext(r.Context(),
"SELECT id FROM channels WHERE name = ?", to).Scan(&chID)
if err != nil {
@@ -387,6 +390,7 @@ func (s *Handlers) handlePart(w http.ResponseWriter, r *http.Request, uid, to st
var chID string
//nolint:gosec // G701: parameterized query, not injection
err := s.params.Database.GetDB().QueryRowContext(r.Context(),
"SELECT id FROM channels WHERE name = ?", channel).Scan(&chID)
if err != nil {
@@ -494,6 +498,7 @@ func (s *Handlers) HandleGetHistory() http.HandlerFunc {
// Channel history — look up channel by name to get its ID for target matching.
var chID string
//nolint:gosec // G701: parameterized query, not injection
err := s.params.Database.GetDB().QueryRowContext(r.Context(),
"SELECT id FROM channels WHERE name = ?", target).Scan(&chID)
if err != nil {