aboutsummaryrefslogtreecommitdiff
path: root/http_handle_group_index.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-22 13:17:55 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-22 13:32:35 +0800
commit7a6f71ac73b41a38e9982bea3d46a87c327bd77a (patch)
tree92d5b637f57080af40c2f42834282df58a4e21a3 /http_handle_group_index.go
parentfedauth: Use NewRequestWithContext (diff)
downloadforge-7a6f71ac73b41a38e9982bea3d46a87c327bd77a.tar.gz
forge-7a6f71ac73b41a38e9982bea3d46a87c327bd77a.tar.zst
forge-7a6f71ac73b41a38e9982bea3d46a87c327bd77a.zip
Initial linting
Diffstat (limited to 'http_handle_group_index.go')
-rw-r--r--http_handle_group_index.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/http_handle_group_index.go b/http_handle_group_index.go
index 22fb548..27d71c5 100644
--- a/http_handle_group_index.go
+++ b/http_handle_group_index.go
@@ -4,6 +4,7 @@
package main
import (
+ "errors"
"net/http"
"path/filepath"
"strconv"
@@ -54,7 +55,7 @@ func httpHandleGroupIndex(w http.ResponseWriter, r *http.Request, params map[str
pgtype.FlatArray[string](groupPath),
).Scan(&groupID, &groupDesc)
- if err == pgx.ErrNoRows {
+ if errors.Is(err, pgx.ErrNoRows) {
errorPage404(w, params)
return
} else if err != nil {
@@ -76,7 +77,7 @@ func httpHandleGroupIndex(w http.ResponseWriter, r *http.Request, params map[str
}
directAccess := (count > 0)
- if r.Method == "POST" {
+ if r.Method == http.MethodPost {
if !directAccess {
http.Error(w, "You do not have direct access to this group", http.StatusForbidden)
return