(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
+4 -4
View File
@@ -2,7 +2,7 @@ package core
import (
"database/sql/driver"
"encoding/json"
"encoding/json/v2"
"fmt"
"slices"
"strconv"
@@ -277,7 +277,7 @@ func (l *FieldsList) add(pos int, newField Field) {
// String returns the string representation of the current list.
func (l FieldsList) String() string {
v, _ := json.Marshal(l)
v, _ := l.MarshalJSON()
return string(v)
}
@@ -355,12 +355,12 @@ func (l FieldsList) MarshalJSON() ([]byte, error) {
wrapper = append(wrapper, data)
}
return json.Marshal(wrapper)
return json.Marshal(wrapper, json.Deterministic(true))
}
// Value implements the [driver.Valuer] interface.
func (l FieldsList) Value() (driver.Value, error) {
data, err := json.Marshal(l)
data, err := l.MarshalJSON()
return string(data), err
}