@@ -305,7 +305,7 @@ func TestD_MarshalJSON(t *testing.T) {
305
305
testcases := []struct {
306
306
name string
307
307
test D
308
- expected interface {}
308
+ expected any
309
309
}{
310
310
{
311
311
"nil" ,
@@ -329,21 +329,21 @@ func TestD_MarshalJSON(t *testing.T) {
329
329
{"g" , D {{"foo" , "bar" }}},
330
330
},
331
331
struct {
332
- A int `json:"a"`
333
- B bool `json:"b"`
334
- C string `json:"c"`
335
- D interface {} `json:"d"`
336
- E float32 `json:"e"`
337
- F []interface {} `json:"f"`
338
- G map [string ]interface {} `json:"g"`
332
+ A int `json:"a"`
333
+ B bool `json:"b"`
334
+ C string `json:"c"`
335
+ D any `json:"d"`
336
+ E float32 `json:"e"`
337
+ F []any `json:"f"`
338
+ G map [string ]any `json:"g"`
339
339
}{
340
340
A : 42 ,
341
341
B : true ,
342
342
C : "answer" ,
343
343
D : nil ,
344
344
E : 2.71828 ,
345
- F : []interface {} {42 , true , "answer" , nil , 2.71828 },
346
- G : map [string ]interface {} {"foo" : "bar" },
345
+ F : []any {42 , true , "answer" , nil , 2.71828 },
346
+ G : map [string ]any {"foo" : "bar" },
347
347
},
348
348
},
349
349
}
@@ -400,7 +400,7 @@ func TestD_UnmarshalJSON(t *testing.T) {
400
400
{"pi" , 3.142 },
401
401
{"boolean" , true },
402
402
{"nothing" , nil },
403
- {"list" , []interface {} {"hello world" , 3.142 , false , nil , D {{"Lorem" , "ipsum" }}}},
403
+ {"list" , []any {"hello world" , 3.142 , false , nil , D {{"Lorem" , "ipsum" }}}},
404
404
{"document" , D {{"foo" , "bar" }}},
405
405
},
406
406
},
@@ -453,7 +453,7 @@ func TestD_UnmarshalJSON(t *testing.T) {
453
453
t .Run (tc .name , func (t * testing.T ) {
454
454
t .Parallel ()
455
455
456
- var a map [string ]interface {}
456
+ var a map [string ]any
457
457
want := json .Unmarshal ([]byte (tc .test ), & a )
458
458
var b D
459
459
got := json .Unmarshal ([]byte (tc .test ), & b )
0 commit comments