(experimental) upgraded to encoding/json/v2

This commit is contained in:
Gani Georgiev
2026-08-18 18:16:22 +03:00
parent 4d4275c9aa
commit 97dd775455
125 changed files with 433 additions and 364 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ package logger
import (
"context"
"encoding/json"
"encoding/json/v2"
"errors"
"log/slog"
"sync"
+2 -1
View File
@@ -2,6 +2,7 @@ package logger
import (
"context"
"encoding/json/v2"
"errors"
"fmt"
"log/slog"
@@ -326,7 +327,7 @@ func TestBatchHandlerAttrsFormat(t *testing.T) {
for i, data := range expected {
t.Run(fmt.Sprintf("log handler %d", i), func(t *testing.T) {
log := beforeLogs[i]
raw, _ := log.Data.MarshalJSON()
raw, _ := json.Marshal(log.Data, json.Deterministic(true))
if string(raw) != data {
t.Fatalf("Expected \n%s \ngot \n%s", data, raw)
}