fix: moved to encoding/json/v2

This commit is contained in:
2026-08-31 18:44:22 +02:00
parent 73df97548b
commit eaf676f8b4
4 changed files with 17 additions and 13 deletions
+1 -6
View File
@@ -2,16 +2,11 @@ package response
import (
"context"
"encoding/json"
"encoding/json/v2"
"log/slog"
"net/http"
)
// TODO: Move to own file
func Status(ctx context.Context, w http.ResponseWriter, status int) {
w.WriteHeader(status)
}
func JSON(ctx context.Context, w http.ResponseWriter, status int, data any) {
payload, err := json.Marshal(data)
if err != nil {