diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-05 08:51:17 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-05 08:51:17 +0800 |
commit | 7c341685f878aa8fd4c49788cf8cc0d8c5c6e127 (patch) | |
tree | 5295f1f4020e85c065e98fcb88ec217ad66e078a /http_handle_index.go | |
parent | config: Add explanatory comments (diff) | |
download | forge-7c341685f878aa8fd4c49788cf8cc0d8c5c6e127.tar.gz forge-7c341685f878aa8fd4c49788cf8cc0d8c5c6e127.tar.zst forge-7c341685f878aa8fd4c49788cf8cc0d8c5c6e127.zip |
*: Replace some := with var
Diffstat (limited to '')
-rw-r--r-- | http_handle_index.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/http_handle_index.go b/http_handle_index.go index 9d424c7..f710315 100644 --- a/http_handle_index.go +++ b/http_handle_index.go @@ -8,7 +8,10 @@ import ( ) func handle_index(w http.ResponseWriter, r *http.Request, params map[string]any) { - groups, err := query_name_desc_list(r.Context(), "SELECT name, COALESCE(description, '') FROM groups") + var err error + var groups []name_desc_t + + groups, err = query_name_desc_list(r.Context(), "SELECT name, COALESCE(description, '') FROM groups") if err != nil { http.Error(w, "Error querying groups: "+err.Error(), http.StatusInternalServerError) return |