@@ -2661,7 +2661,7 @@ func TestMarshal(t *testing.T) {
2661
2661
}, {
2662
2662
name : jsontest .Name ("Structs/InlinedFallback/MapStringInt/MarshalFunc" ),
2663
2663
opts : []Options {
2664
- WithMarshalers (NewMarshalers (
2664
+ WithMarshalers (JoinMarshalers (
2665
2665
// Marshalers do not affect the string key of inlined maps.
2666
2666
MarshalFunc (func (v string ) ([]byte , error ) {
2667
2667
return []byte (fmt .Sprintf (`"%q"` , strings .ToUpper (v ))), nil
@@ -3594,7 +3594,7 @@ func TestMarshal(t *testing.T) {
3594
3594
}, {
3595
3595
name : jsontest .Name ("Functions/Bool/Empty2/NoMatch" ),
3596
3596
opts : []Options {
3597
- WithMarshalers (NewMarshalers ()),
3597
+ WithMarshalers (JoinMarshalers ()),
3598
3598
},
3599
3599
in : true ,
3600
3600
want : `true` ,
@@ -3854,7 +3854,7 @@ func TestMarshal(t *testing.T) {
3854
3854
}, {
3855
3855
name : jsontest .Name ("Funtions/Struct/Fields" ),
3856
3856
opts : []Options {
3857
- WithMarshalers (NewMarshalers (
3857
+ WithMarshalers (JoinMarshalers (
3858
3858
MarshalFunc (func (v bool ) ([]byte , error ) {
3859
3859
return []byte (`"called1"` ), nil
3860
3860
}),
@@ -3874,7 +3874,7 @@ func TestMarshal(t *testing.T) {
3874
3874
}, {
3875
3875
name : jsontest .Name ("Functions/Struct/OmitEmpty" ),
3876
3876
opts : []Options {
3877
- WithMarshalers (NewMarshalers (
3877
+ WithMarshalers (JoinMarshalers (
3878
3878
MarshalFunc (func (v bool ) ([]byte , error ) {
3879
3879
return []byte (`null` ), nil
3880
3880
}),
@@ -3906,7 +3906,7 @@ func TestMarshal(t *testing.T) {
3906
3906
}, {
3907
3907
name : jsontest .Name ("Functions/Struct/OmitZero" ),
3908
3908
opts : []Options {
3909
- WithMarshalers (NewMarshalers (
3909
+ WithMarshalers (JoinMarshalers (
3910
3910
MarshalFunc (func (v bool ) ([]byte , error ) {
3911
3911
panic ("should not be called" )
3912
3912
}),
@@ -3926,7 +3926,7 @@ func TestMarshal(t *testing.T) {
3926
3926
}, {
3927
3927
name : jsontest .Name ("Functions/Struct/Inlined" ),
3928
3928
opts : []Options {
3929
- WithMarshalers (NewMarshalers (
3929
+ WithMarshalers (JoinMarshalers (
3930
3930
MarshalFunc (func (v structInlinedL1 ) ([]byte , error ) {
3931
3931
panic ("should not be called" )
3932
3932
}),
@@ -4219,7 +4219,7 @@ func TestMarshal(t *testing.T) {
4219
4219
return checkLast ()
4220
4220
})
4221
4221
4222
- return NewMarshalers (
4222
+ return JoinMarshalers (
4223
4223
anyMarshaler ,
4224
4224
pointerAnyMarshaler ,
4225
4225
namedAnyMarshaler ,
@@ -4237,7 +4237,7 @@ func TestMarshal(t *testing.T) {
4237
4237
}, {
4238
4238
name : jsontest .Name ("Functions/Precedence/V1First" ),
4239
4239
opts : []Options {
4240
- WithMarshalers (NewMarshalers (
4240
+ WithMarshalers (JoinMarshalers (
4241
4241
MarshalFunc (func (bool ) ([]byte , error ) {
4242
4242
return []byte (`"called"` ), nil
4243
4243
}),
@@ -4251,7 +4251,7 @@ func TestMarshal(t *testing.T) {
4251
4251
}, {
4252
4252
name : jsontest .Name ("Functions/Precedence/V2First" ),
4253
4253
opts : []Options {
4254
- WithMarshalers (NewMarshalers (
4254
+ WithMarshalers (JoinMarshalers (
4255
4255
MarshalToFunc (func (enc * jsontext.Encoder , v bool , opts Options ) error {
4256
4256
return enc .WriteToken (jsontext .String ("called" ))
4257
4257
}),
@@ -4265,7 +4265,7 @@ func TestMarshal(t *testing.T) {
4265
4265
}, {
4266
4266
name : jsontest .Name ("Functions/Precedence/V2Skipped" ),
4267
4267
opts : []Options {
4268
- WithMarshalers (NewMarshalers (
4268
+ WithMarshalers (JoinMarshalers (
4269
4269
MarshalToFunc (func (enc * jsontext.Encoder , v bool , opts Options ) error {
4270
4270
return SkipFunc
4271
4271
}),
@@ -4279,8 +4279,8 @@ func TestMarshal(t *testing.T) {
4279
4279
}, {
4280
4280
name : jsontest .Name ("Functions/Precedence/NestedFirst" ),
4281
4281
opts : []Options {
4282
- WithMarshalers (NewMarshalers (
4283
- NewMarshalers (
4282
+ WithMarshalers (JoinMarshalers (
4283
+ JoinMarshalers (
4284
4284
MarshalFunc (func (bool ) ([]byte , error ) {
4285
4285
return []byte (`"called"` ), nil
4286
4286
}),
@@ -4295,11 +4295,11 @@ func TestMarshal(t *testing.T) {
4295
4295
}, {
4296
4296
name : jsontest .Name ("Functions/Precedence/NestedLast" ),
4297
4297
opts : []Options {
4298
- WithMarshalers (NewMarshalers (
4298
+ WithMarshalers (JoinMarshalers (
4299
4299
MarshalFunc (func (bool ) ([]byte , error ) {
4300
4300
return []byte (`"called"` ), nil
4301
4301
}),
4302
- NewMarshalers (
4302
+ JoinMarshalers (
4303
4303
MarshalFunc (func (bool ) ([]byte , error ) {
4304
4304
panic ("should not be called" )
4305
4305
}),
@@ -7972,7 +7972,7 @@ func TestUnmarshal(t *testing.T) {
7972
7972
}, {
7973
7973
name : jsontest .Name ("Functions/String/Empty2/NoMatch" ),
7974
7974
opts : []Options {
7975
- WithUnmarshalers (NewUnmarshalers ()),
7975
+ WithUnmarshalers (JoinUnmarshalers ()),
7976
7976
},
7977
7977
inBuf : `""` ,
7978
7978
inVal : addr ("" ),
@@ -8216,7 +8216,7 @@ func TestUnmarshal(t *testing.T) {
8216
8216
}, {
8217
8217
name : jsontest .Name ("Funtions/Struct/Fields" ),
8218
8218
opts : []Options {
8219
- WithUnmarshalers (NewUnmarshalers (
8219
+ WithUnmarshalers (JoinUnmarshalers (
8220
8220
UnmarshalFunc (func (b []byte , v * bool ) error {
8221
8221
if string (b ) != `"called1"` {
8222
8222
return fmt .Errorf ("got %s, want %s" , b , `"called1"` )
@@ -8259,7 +8259,7 @@ func TestUnmarshal(t *testing.T) {
8259
8259
}, {
8260
8260
name : jsontest .Name ("Functions/Struct/Inlined" ),
8261
8261
opts : []Options {
8262
- WithUnmarshalers (NewUnmarshalers (
8262
+ WithUnmarshalers (JoinUnmarshalers (
8263
8263
UnmarshalFunc (func ([]byte , * structInlinedL1 ) error {
8264
8264
panic ("should not be called" )
8265
8265
}),
@@ -8370,7 +8370,7 @@ func TestUnmarshal(t *testing.T) {
8370
8370
}, {
8371
8371
name : jsontest .Name ("Functions/Interface/NilPointerNetIP/Override" ),
8372
8372
opts : []Options {
8373
- WithUnmarshalers (NewUnmarshalers (
8373
+ WithUnmarshalers (JoinUnmarshalers (
8374
8374
UnmarshalFromFunc (func (dec * jsontext.Decoder , v * fmt.Stringer , opts Options ) error {
8375
8375
* v = (* net .IP )(nil )
8376
8376
return SkipFunc
@@ -8578,7 +8578,7 @@ func TestUnmarshal(t *testing.T) {
8578
8578
return checkLast ()
8579
8579
})
8580
8580
8581
- return NewUnmarshalers (
8581
+ return JoinUnmarshalers (
8582
8582
// This is just like unmarshaling into a Go array,
8583
8583
// but avoids zeroing the element before calling unmarshal.
8584
8584
UnmarshalFromFunc (func (dec * jsontext.Decoder , v * [14 ]any , opts Options ) error {
@@ -8611,7 +8611,7 @@ func TestUnmarshal(t *testing.T) {
8611
8611
}, {
8612
8612
name : jsontest .Name ("Functions/Precedence/V1First" ),
8613
8613
opts : []Options {
8614
- WithUnmarshalers (NewUnmarshalers (
8614
+ WithUnmarshalers (JoinUnmarshalers (
8615
8615
UnmarshalFunc (func (b []byte , v * string ) error {
8616
8616
if string (b ) != `"called"` {
8617
8617
return fmt .Errorf ("got %s, want %s" , b , `"called"` )
@@ -8630,7 +8630,7 @@ func TestUnmarshal(t *testing.T) {
8630
8630
}, {
8631
8631
name : jsontest .Name ("Functions/Precedence/V2First" ),
8632
8632
opts : []Options {
8633
- WithUnmarshalers (NewUnmarshalers (
8633
+ WithUnmarshalers (JoinUnmarshalers (
8634
8634
UnmarshalFromFunc (func (dec * jsontext.Decoder , v * string , opts Options ) error {
8635
8635
switch t , err := dec .ReadToken (); {
8636
8636
case err != nil :
@@ -8652,7 +8652,7 @@ func TestUnmarshal(t *testing.T) {
8652
8652
}, {
8653
8653
name : jsontest .Name ("Functions/Precedence/V2Skipped" ),
8654
8654
opts : []Options {
8655
- WithUnmarshalers (NewUnmarshalers (
8655
+ WithUnmarshalers (JoinUnmarshalers (
8656
8656
UnmarshalFromFunc (func (dec * jsontext.Decoder , v * string , opts Options ) error {
8657
8657
return SkipFunc
8658
8658
}),
@@ -8671,8 +8671,8 @@ func TestUnmarshal(t *testing.T) {
8671
8671
}, {
8672
8672
name : jsontest .Name ("Functions/Precedence/NestedFirst" ),
8673
8673
opts : []Options {
8674
- WithUnmarshalers (NewUnmarshalers (
8675
- NewUnmarshalers (
8674
+ WithUnmarshalers (JoinUnmarshalers (
8675
+ JoinUnmarshalers (
8676
8676
UnmarshalFunc (func (b []byte , v * string ) error {
8677
8677
if string (b ) != `"called"` {
8678
8678
return fmt .Errorf ("got %s, want %s" , b , `"called"` )
@@ -8692,15 +8692,15 @@ func TestUnmarshal(t *testing.T) {
8692
8692
}, {
8693
8693
name : jsontest .Name ("Functions/Precedence/NestedLast" ),
8694
8694
opts : []Options {
8695
- WithUnmarshalers (NewUnmarshalers (
8695
+ WithUnmarshalers (JoinUnmarshalers (
8696
8696
UnmarshalFunc (func (b []byte , v * string ) error {
8697
8697
if string (b ) != `"called"` {
8698
8698
return fmt .Errorf ("got %s, want %s" , b , `"called"` )
8699
8699
}
8700
8700
* v = "called"
8701
8701
return nil
8702
8702
}),
8703
- NewUnmarshalers (
8703
+ JoinUnmarshalers (
8704
8704
UnmarshalFunc (func ([]byte , * string ) error {
8705
8705
panic ("should not be called" )
8706
8706
}),
0 commit comments