fix more liniting errors

This commit is contained in:
2025-12-23 14:33:35 +01:00
parent 38d3d2c442
commit 2b66c57f4c
2 changed files with 10 additions and 2 deletions

View File

@@ -148,5 +148,8 @@ func RestSet(resp http.ResponseWriter, req *http.Request, conf *cfg.Config) {
}
func Home(resp http.ResponseWriter) {
resp.Write([]byte("Use the REST API on " + apiprefix + "\r\n"))
_, err := resp.Write([]byte("Use the REST API on " + apiprefix + "\r\n"))
if err != nil {
log.Fatal(err)
}
}

View File

@@ -18,6 +18,7 @@ package rest
import (
"encoding/json"
"log"
"net/http"
"codeberg.org/scip/anydb/cfg"
@@ -78,10 +79,14 @@ func JsonStatus(resp http.ResponseWriter, code int, msg string) {
resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(code)
json.NewEncoder(resp).Encode(
err := json.NewEncoder(resp).Encode(
Result{
Code: code,
Message: msg,
Success: success,
})
if err != nil {
log.Fatal(err)
}
}