Revert gojson changes
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m34s

This commit is contained in:
2026-04-26 14:29:28 +02:00
parent d30e778bd4
commit 18c172d69a
6 changed files with 53 additions and 35 deletions
+15 -14
View File
@@ -41,7 +41,7 @@ type Optionals struct {
Uo uint `json:"uo,omitempty"`
Str struct{} `json:"str"`
Sto struct{} `json:"sto"`
Sto struct{} `json:"sto,omitempty"`
}
func TestOmitEmpty(t *testing.T) {
@@ -1166,7 +1166,8 @@ func TestMarshalUncommonFieldNames(t *testing.T) {
}
func TestMarshalerError(t *testing.T) {
st := reflect.TypeFor[string]()
s := "test variable"
st := reflect.TypeOf(s)
const errText = "json: test error"
tests := []struct {
@@ -1221,18 +1222,18 @@ func TestIssue63379(t *testing.T) {
func TestMarshalSafeCollections(t *testing.T) {
var (
nilSlice []any
pNilSlice *[]any
nilMap map[string]any
pNilMap *map[string]any
nilSlice []interface{}
pNilSlice *[]interface{}
nilMap map[string]interface{}
pNilMap *map[string]interface{}
)
type (
nilSliceStruct struct {
NilSlice []any `json:"nil_slice"`
NilSlice []interface{} `json:"nil_slice"`
}
nilMapStruct struct {
NilMap map[string]any `json:"nil_map"`
NilMap map[string]interface{} `json:"nil_map"`
}
testWithFilter struct {
Test1 string `json:"test1" jsonfilter:"FILTERONE"`
@@ -1241,19 +1242,19 @@ func TestMarshalSafeCollections(t *testing.T) {
)
tests := []struct {
in any
in interface{}
want string
}{
{nilSlice, "[]"},
{[]any{}, "[]"},
{make([]any, 0), "[]"},
{[]interface{}{}, "[]"},
{make([]interface{}, 0), "[]"},
{[]int{1, 2, 3}, "[1,2,3]"},
{pNilSlice, "null"},
{nilSliceStruct{}, "{\"nil_slice\":[]}"},
{nilMap, "{}"},
{map[string]any{}, "{}"},
{make(map[string]any, 0), "{}"},
{map[string]any{"1": 1, "2": 2, "3": 3}, "{\"1\":1,\"2\":2,\"3\":3}"},
{map[string]interface{}{}, "{}"},
{make(map[string]interface{}, 0), "{}"},
{map[string]interface{}{"1": 1, "2": 2, "3": 3}, "{\"1\":1,\"2\":2,\"3\":3}"},
{pNilMap, "null"},
{nilMapStruct{}, "{\"nil_map\":{}}"},
{testWithFilter{}, "{\"test1\":\"\"}"},