github.com/night-codes/go-json@v0.9.15/test/cover/cover_marshal_json_test.go (about) 1 package json_test 2 3 import ( 4 "bytes" 5 "fmt" 6 "testing" 7 8 "github.com/night-codes/go-json" 9 ) 10 11 type coverMarshalJSON struct { 12 A int 13 } 14 15 func (c coverMarshalJSON) MarshalJSON() ([]byte, error) { 16 return []byte(fmt.Sprint(c.A)), nil 17 } 18 19 type coverPtrMarshalJSON struct { 20 B int 21 } 22 23 func (c *coverPtrMarshalJSON) MarshalJSON() ([]byte, error) { 24 if c == nil { 25 return []byte(`"NULL"`), nil 26 } 27 return []byte(fmt.Sprint(c.B)), nil 28 } 29 30 type coverPtrMarshalJSONString struct { 31 dummy int 32 C string 33 } 34 35 func (c *coverPtrMarshalJSONString) MarshalJSON() ([]byte, error) { 36 if c == nil { 37 return []byte(`"NULL"`), nil 38 } 39 return []byte(c.C), nil 40 } 41 42 type coverFuncMarshalJSON func() 43 44 func (f coverFuncMarshalJSON) MarshalJSON() ([]byte, error) { 45 if f == nil { 46 return []byte(`null`), nil 47 } 48 f() 49 return []byte(`"func"`), nil 50 } 51 52 func TestCoverMarshalJSON(t *testing.T) { 53 type structMarshalJSON struct { 54 A coverMarshalJSON `json:"a"` 55 } 56 type structMarshalJSONOmitEmpty struct { 57 A coverMarshalJSON `json:"a,omitempty"` 58 } 59 type structMarshalJSONString struct { 60 A coverMarshalJSON `json:"a,string"` 61 } 62 type structPtrMarshalJSON struct { 63 A coverPtrMarshalJSON `json:"a"` 64 } 65 type structPtrMarshalJSONOmitEmpty struct { 66 A coverPtrMarshalJSON `json:"a,omitempty"` 67 } 68 type structPtrMarshalJSONString struct { 69 A coverPtrMarshalJSON `json:"a,string"` 70 } 71 72 type structMarshalJSONPtr struct { 73 A *coverMarshalJSON `json:"a"` 74 } 75 type structMarshalJSONPtrOmitEmpty struct { 76 A *coverMarshalJSON `json:"a,omitempty"` 77 } 78 type structMarshalJSONPtrString struct { 79 A *coverMarshalJSON `json:"a,string"` 80 } 81 type structPtrMarshalJSONPtr struct { 82 A *coverPtrMarshalJSON `json:"a"` 83 } 84 type structPtrMarshalJSONPtrOmitEmpty struct { 85 A *coverPtrMarshalJSON `json:"a,omitempty"` 86 } 87 type structPtrMarshalJSONPtrString struct { 88 A *coverPtrMarshalJSON `json:"a,string"` 89 } 90 91 tests := []struct { 92 name string 93 data interface{} 94 }{ 95 { 96 name: "FuncMarshalJSON", 97 data: coverFuncMarshalJSON(func() {}), 98 }, 99 { 100 name: "StructFuncMarshalJSON", 101 data: struct { 102 A coverFuncMarshalJSON 103 }{A: func() {}}, 104 }, 105 { 106 name: "StructFuncMarshalJSONMultiFields", 107 data: struct { 108 A coverFuncMarshalJSON 109 B coverFuncMarshalJSON 110 }{A: func() {}, B: func() {}}, 111 }, 112 { 113 name: "PtrStructFuncMarshalJSONMultiFields", 114 data: &struct { 115 A coverFuncMarshalJSON 116 B coverFuncMarshalJSON 117 C coverFuncMarshalJSON 118 }{A: func() {}, B: nil, C: func() {}}, 119 }, 120 { 121 name: "MarshalJSON", 122 data: coverMarshalJSON{A: 1}, 123 }, 124 { 125 name: "PtrMarshalJSON", 126 data: &coverMarshalJSON{A: 1}, 127 }, 128 { 129 name: "PtrMarshalJSON", 130 data: coverPtrMarshalJSON{B: 1}, 131 }, 132 { 133 name: "PtrPtrMarshalJSON", 134 data: &coverPtrMarshalJSON{B: 1}, 135 }, 136 { 137 name: "SliceMarshalJSON", 138 data: []coverMarshalJSON{{A: 1}, {A: 2}}, 139 }, 140 { 141 name: "SliceAddrMarshalJSON", 142 data: []*coverMarshalJSON{{A: 1}, {A: 2}}, 143 }, 144 { 145 name: "SlicePtrMarshalJSON", 146 data: []coverPtrMarshalJSON{{B: 1}, {B: 2}}, 147 }, 148 { 149 name: "SliceAddrPtrMarshalJSON", 150 data: []*coverPtrMarshalJSON{{B: 1}, {B: 2}}, 151 }, 152 { 153 name: "StructSliceMarshalJSON", 154 data: struct { 155 A []coverMarshalJSON 156 }{A: []coverMarshalJSON{{A: 1}, {A: 2}}}, 157 }, 158 { 159 name: "StructSliceAddrMarshalJSON", 160 data: struct { 161 A []*coverMarshalJSON 162 }{A: []*coverMarshalJSON{{A: 1}, {A: 2}}}, 163 }, 164 { 165 name: "StructSlicePtrMarshalJSON", 166 data: struct { 167 A []coverPtrMarshalJSON 168 }{A: []coverPtrMarshalJSON{{B: 1}, {B: 2}}}, 169 }, 170 { 171 name: "StructSliceAddrPtrMarshalJSON", 172 data: struct { 173 A []*coverPtrMarshalJSON 174 }{A: []*coverPtrMarshalJSON{{B: 1}, {B: 2}}}, 175 }, 176 { 177 name: "PtrStructSliceMarshalJSON", 178 data: &struct { 179 A []coverMarshalJSON 180 }{A: []coverMarshalJSON{{A: 1}, {A: 2}}}, 181 }, 182 { 183 name: "PtrStructSliceAddrMarshalJSON", 184 data: &struct { 185 A []*coverMarshalJSON 186 }{A: []*coverMarshalJSON{{A: 1}, {A: 2}}}, 187 }, 188 { 189 name: "PtrStructSlicePtrMarshalJSON", 190 data: &struct { 191 A []coverPtrMarshalJSON 192 }{A: []coverPtrMarshalJSON{{B: 1}, {B: 2}}}, 193 }, 194 { 195 name: "PtrStructSlicePtrMarshalJSONString", 196 data: &struct { 197 A []coverPtrMarshalJSONString 198 }{A: []coverPtrMarshalJSONString{{C: "1"}, {C: "2"}}}, 199 }, 200 { 201 name: "PtrStructSliceAddrPtrMarshalJSONString", 202 data: &struct { 203 A []*coverPtrMarshalJSONString 204 }{A: []*coverPtrMarshalJSONString{{C: "1"}, {C: "2"}}}, 205 }, 206 { 207 name: "PtrStructArrayPtrMarshalJSONString", 208 data: &struct { 209 A [2]coverPtrMarshalJSONString 210 }{A: [2]coverPtrMarshalJSONString{{C: "1"}, {C: "2"}}}, 211 }, 212 { 213 name: "PtrStructArrayAddrPtrMarshalJSONString", 214 data: &struct { 215 A [2]*coverPtrMarshalJSONString 216 }{A: [2]*coverPtrMarshalJSONString{{C: "1"}, {C: "2"}}}, 217 }, 218 { 219 name: "PtrStructMapPtrMarshalJSONString", 220 data: &struct { 221 A map[string]coverPtrMarshalJSONString 222 }{A: map[string]coverPtrMarshalJSONString{"a": {C: "1"}, "b": {C: "2"}}}, 223 }, 224 { 225 name: "PtrStructMapAddrPtrMarshalJSONString", 226 data: &struct { 227 A map[string]*coverPtrMarshalJSONString 228 }{A: map[string]*coverPtrMarshalJSONString{"a": {C: "1"}, "b": {C: "2"}}}, 229 }, 230 231 // HeadMarshalJSONZero 232 { 233 name: "HeadMarshalJSONZero", 234 data: struct { 235 A coverMarshalJSON `json:"a"` 236 }{}, 237 }, 238 { 239 name: "HeadMarshalJSONZeroOmitEmpty", 240 data: struct { 241 A coverMarshalJSON `json:"a,omitempty"` 242 }{}, 243 }, 244 { 245 name: "HeadMarshalJSONZeroString", 246 data: struct { 247 A coverMarshalJSON `json:"a,string"` 248 }{}, 249 }, 250 { 251 name: "HeadPtrMarshalJSONZero", 252 data: struct { 253 A coverPtrMarshalJSON `json:"a"` 254 }{}, 255 }, 256 { 257 name: "HeadPtrMarshalJSONZeroOmitEmpty", 258 data: struct { 259 A coverPtrMarshalJSON `json:"a,omitempty"` 260 }{}, 261 }, 262 { 263 name: "HeadPtrMarshalJSONZeroString", 264 data: struct { 265 A coverPtrMarshalJSON `json:"a,string"` 266 }{}, 267 }, 268 269 // HeadMarshalJSON 270 { 271 name: "HeadMarshalJSON", 272 data: struct { 273 A coverMarshalJSON `json:"a"` 274 }{A: coverMarshalJSON{}}, 275 }, 276 { 277 name: "HeadMarshalJSONOmitEmpty", 278 data: struct { 279 A coverMarshalJSON `json:"a,omitempty"` 280 }{A: coverMarshalJSON{}}, 281 }, 282 { 283 name: "HeadMarshalJSONString", 284 data: struct { 285 A coverMarshalJSON `json:"a,string"` 286 }{A: coverMarshalJSON{}}, 287 }, 288 { 289 name: "HeadPtrMarshalJSON", 290 data: struct { 291 A coverPtrMarshalJSON `json:"a"` 292 }{A: coverPtrMarshalJSON{}}, 293 }, 294 { 295 name: "HeadPtrMarshalJSONOmitEmpty", 296 data: struct { 297 A coverPtrMarshalJSON `json:"a,omitempty"` 298 }{A: coverPtrMarshalJSON{}}, 299 }, 300 { 301 name: "HeadPtrMarshalJSONString", 302 data: struct { 303 A coverPtrMarshalJSON `json:"a,string"` 304 }{A: coverPtrMarshalJSON{}}, 305 }, 306 307 // HeadMarshalJSONPtr 308 { 309 name: "HeadMarshalJSONPtr", 310 data: struct { 311 A *coverMarshalJSON `json:"a"` 312 }{A: &coverMarshalJSON{}}, 313 }, 314 { 315 name: "HeadMarshalJSONPtrOmitEmpty", 316 data: struct { 317 A *coverMarshalJSON `json:"a,omitempty"` 318 }{A: &coverMarshalJSON{}}, 319 }, 320 { 321 name: "HeadMarshalJSONPtrString", 322 data: struct { 323 A *coverMarshalJSON `json:"a,string"` 324 }{A: &coverMarshalJSON{}}, 325 }, 326 { 327 name: "HeadPtrMarshalJSONPtr", 328 data: struct { 329 A *coverPtrMarshalJSON `json:"a"` 330 }{A: &coverPtrMarshalJSON{}}, 331 }, 332 { 333 name: "HeadPtrMarshalJSONPtrOmitEmpty", 334 data: struct { 335 A *coverPtrMarshalJSON `json:"a,omitempty"` 336 }{A: &coverPtrMarshalJSON{}}, 337 }, 338 { 339 name: "HeadPtrMarshalJSONPtrString", 340 data: struct { 341 A *coverPtrMarshalJSON `json:"a,string"` 342 }{A: &coverPtrMarshalJSON{}}, 343 }, 344 345 // HeadMarshalJSONPtrNil 346 { 347 name: "HeadMarshalJSONPtrNil", 348 data: struct { 349 A *coverMarshalJSON `json:"a"` 350 }{A: nil}, 351 }, 352 { 353 name: "HeadMarshalJSONPtrNilOmitEmpty", 354 data: struct { 355 A *coverMarshalJSON `json:"a,omitempty"` 356 }{A: nil}, 357 }, 358 { 359 name: "HeadMarshalJSONPtrNilString", 360 data: struct { 361 A *coverMarshalJSON `json:"a,string"` 362 }{A: nil}, 363 }, 364 { 365 name: "HeadPtrMarshalJSONPtrNil", 366 data: struct { 367 A *coverPtrMarshalJSON `json:"a"` 368 }{A: nil}, 369 }, 370 { 371 name: "HeadPtrMarshalJSONPtrNilOmitEmpty", 372 data: struct { 373 A *coverPtrMarshalJSON `json:"a,omitempty"` 374 }{A: nil}, 375 }, 376 { 377 name: "HeadPtrMarshalJSONPtrNilString", 378 data: struct { 379 A *coverPtrMarshalJSON `json:"a,string"` 380 }{A: nil}, 381 }, 382 383 // PtrHeadMarshalJSONZero 384 { 385 name: "PtrHeadMarshalJSONZero", 386 data: &struct { 387 A coverMarshalJSON `json:"a"` 388 }{}, 389 }, 390 { 391 name: "PtrHeadMarshalJSONZeroOmitEmpty", 392 data: &struct { 393 A coverMarshalJSON `json:"a,omitempty"` 394 }{}, 395 }, 396 { 397 name: "PtrHeadMarshalJSONZeroString", 398 data: &struct { 399 A coverMarshalJSON `json:"a,string"` 400 }{}, 401 }, 402 { 403 name: "PtrHeadPtrMarshalJSONZero", 404 data: &struct { 405 A coverPtrMarshalJSON `json:"a"` 406 }{}, 407 }, 408 { 409 name: "PtrHeadPtrMarshalJSONZeroOmitEmpty", 410 data: &struct { 411 A coverPtrMarshalJSON `json:"a,omitempty"` 412 }{}, 413 }, 414 { 415 name: "PtrHeadPtrMarshalJSONZeroString", 416 data: &struct { 417 A coverPtrMarshalJSON `json:"a,string"` 418 }{}, 419 }, 420 421 // PtrHeadMarshalJSON 422 { 423 name: "PtrHeadMarshalJSON", 424 data: &struct { 425 A coverMarshalJSON `json:"a"` 426 }{A: coverMarshalJSON{}}, 427 }, 428 { 429 name: "PtrHeadMarshalJSONOmitEmpty", 430 data: &struct { 431 A coverMarshalJSON `json:"a,omitempty"` 432 }{A: coverMarshalJSON{}}, 433 }, 434 { 435 name: "PtrHeadMarshalJSONString", 436 data: &struct { 437 A coverMarshalJSON `json:"a,string"` 438 }{A: coverMarshalJSON{}}, 439 }, 440 { 441 name: "PtrHeadPtrMarshalJSON", 442 data: &struct { 443 A coverPtrMarshalJSON `json:"a"` 444 }{A: coverPtrMarshalJSON{}}, 445 }, 446 { 447 name: "PtrHeadPtrMarshalJSONOmitEmpty", 448 data: &struct { 449 A coverPtrMarshalJSON `json:"a,omitempty"` 450 }{A: coverPtrMarshalJSON{}}, 451 }, 452 { 453 name: "PtrHeadPtrMarshalJSONString", 454 data: &struct { 455 A coverPtrMarshalJSON `json:"a,string"` 456 }{A: coverPtrMarshalJSON{}}, 457 }, 458 459 // PtrHeadMarshalJSONPtr 460 { 461 name: "PtrHeadMarshalJSONPtr", 462 data: &struct { 463 A *coverMarshalJSON `json:"a"` 464 }{A: &coverMarshalJSON{}}, 465 }, 466 { 467 name: "PtrHeadMarshalJSONPtrOmitEmpty", 468 data: &struct { 469 A *coverMarshalJSON `json:"a,omitempty"` 470 }{A: &coverMarshalJSON{}}, 471 }, 472 { 473 name: "PtrHeadMarshalJSONPtrString", 474 data: &struct { 475 A *coverMarshalJSON `json:"a,string"` 476 }{A: &coverMarshalJSON{}}, 477 }, 478 { 479 name: "PtrHeadPtrMarshalJSONPtr", 480 data: &struct { 481 A *coverPtrMarshalJSON `json:"a"` 482 }{A: &coverPtrMarshalJSON{}}, 483 }, 484 { 485 name: "PtrHeadPtrMarshalJSONPtrOmitEmpty", 486 data: &struct { 487 A *coverPtrMarshalJSON `json:"a,omitempty"` 488 }{A: &coverPtrMarshalJSON{}}, 489 }, 490 { 491 name: "PtrHeadPtrMarshalJSONPtrString", 492 data: &struct { 493 A *coverPtrMarshalJSON `json:"a,string"` 494 }{A: &coverPtrMarshalJSON{}}, 495 }, 496 497 // PtrHeadMarshalJSONPtrNil 498 { 499 name: "PtrHeadMarshalJSONPtrNil", 500 data: &struct { 501 A *coverMarshalJSON `json:"a"` 502 }{A: nil}, 503 }, 504 { 505 name: "PtrHeadMarshalJSONPtrNilOmitEmpty", 506 data: &struct { 507 A *coverMarshalJSON `json:"a,omitempty"` 508 }{A: nil}, 509 }, 510 { 511 name: "PtrHeadMarshalJSONPtrNilString", 512 data: &struct { 513 A *coverMarshalJSON `json:"a,string"` 514 }{A: nil}, 515 }, 516 { 517 name: "PtrHeadPtrMarshalJSONPtrNil", 518 data: &struct { 519 A *coverPtrMarshalJSON `json:"a"` 520 }{A: nil}, 521 }, 522 { 523 name: "PtrHeadPtrMarshalJSONPtrNilOmitEmpty", 524 data: &struct { 525 A *coverPtrMarshalJSON `json:"a,omitempty"` 526 }{A: nil}, 527 }, 528 { 529 name: "PtrHeadPtrMarshalJSONPtrNilString", 530 data: &struct { 531 A *coverPtrMarshalJSON `json:"a,string"` 532 }{A: nil}, 533 }, 534 535 // PtrHeadMarshalJSONNil 536 { 537 name: "PtrHeadMarshalJSONNil", 538 data: (*struct { 539 A *coverMarshalJSON `json:"a"` 540 })(nil), 541 }, 542 { 543 name: "PtrHeadMarshalJSONNilOmitEmpty", 544 data: (*struct { 545 A *coverMarshalJSON `json:"a,omitempty"` 546 })(nil), 547 }, 548 { 549 name: "PtrHeadMarshalJSONNilString", 550 data: (*struct { 551 A *coverMarshalJSON `json:"a,string"` 552 })(nil), 553 }, 554 { 555 name: "PtrHeadPtrMarshalJSONNil", 556 data: (*struct { 557 A *coverPtrMarshalJSON `json:"a"` 558 })(nil), 559 }, 560 { 561 name: "PtrHeadPtrMarshalJSONNilOmitEmpty", 562 data: (*struct { 563 A *coverPtrMarshalJSON `json:"a,omitempty"` 564 })(nil), 565 }, 566 { 567 name: "PtrHeadPtrMarshalJSONNilString", 568 data: (*struct { 569 A *coverPtrMarshalJSON `json:"a,string"` 570 })(nil), 571 }, 572 573 // HeadMarshalJSONZeroMultiFields 574 { 575 name: "HeadMarshalJSONZeroMultiFields", 576 data: struct { 577 A coverMarshalJSON `json:"a"` 578 B coverMarshalJSON `json:"b"` 579 C coverMarshalJSON `json:"c"` 580 }{}, 581 }, 582 { 583 name: "HeadMarshalJSONZeroMultiFieldsOmitEmpty", 584 data: struct { 585 A coverMarshalJSON `json:"a,omitempty"` 586 B coverMarshalJSON `json:"b,omitempty"` 587 C coverMarshalJSON `json:"c,omitempty"` 588 }{}, 589 }, 590 { 591 name: "HeadMarshalJSONZeroMultiFields", 592 data: struct { 593 A coverMarshalJSON `json:"a,string"` 594 B coverMarshalJSON `json:"b,string"` 595 C coverMarshalJSON `json:"c,string"` 596 }{}, 597 }, 598 { 599 name: "HeadPtrMarshalJSONZeroMultiFields", 600 data: struct { 601 A coverPtrMarshalJSON `json:"a"` 602 B coverPtrMarshalJSON `json:"b"` 603 C coverPtrMarshalJSON `json:"c"` 604 }{}, 605 }, 606 { 607 name: "HeadPtrMarshalJSONZeroMultiFieldsOmitEmpty", 608 data: struct { 609 A coverPtrMarshalJSON `json:"a,omitempty"` 610 B coverPtrMarshalJSON `json:"b,omitempty"` 611 C coverPtrMarshalJSON `json:"c,omitempty"` 612 }{}, 613 }, 614 { 615 name: "HeadPtrMarshalJSONZeroMultiFields", 616 data: struct { 617 A coverPtrMarshalJSON `json:"a,string"` 618 B coverPtrMarshalJSON `json:"b,string"` 619 C coverPtrMarshalJSON `json:"c,string"` 620 }{}, 621 }, 622 623 // HeadMarshalJSONMultiFields 624 { 625 name: "HeadMarshalJSONMultiFields", 626 data: struct { 627 A coverMarshalJSON `json:"a"` 628 B coverMarshalJSON `json:"b"` 629 C coverMarshalJSON `json:"c"` 630 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}, C: coverMarshalJSON{}}, 631 }, 632 { 633 name: "HeadMarshalJSONMultiFieldsOmitEmpty", 634 data: struct { 635 A coverMarshalJSON `json:"a,omitempty"` 636 B coverMarshalJSON `json:"b,omitempty"` 637 C coverMarshalJSON `json:"c,omitempty"` 638 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}, C: coverMarshalJSON{}}, 639 }, 640 { 641 name: "HeadMarshalJSONMultiFieldsString", 642 data: struct { 643 A coverMarshalJSON `json:"a,string"` 644 B coverMarshalJSON `json:"b,string"` 645 C coverMarshalJSON `json:"c,string"` 646 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}, C: coverMarshalJSON{}}, 647 }, 648 { 649 name: "HeadPtrMarshalJSONMultiFields", 650 data: struct { 651 A coverPtrMarshalJSON `json:"a"` 652 B coverPtrMarshalJSON `json:"b"` 653 C coverPtrMarshalJSON `json:"c"` 654 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}, C: coverPtrMarshalJSON{}}, 655 }, 656 { 657 name: "HeadPtrMarshalJSONMultiFieldsOmitEmpty", 658 data: struct { 659 A coverPtrMarshalJSON `json:"a,omitempty"` 660 B coverPtrMarshalJSON `json:"b,omitempty"` 661 C coverPtrMarshalJSON `json:"c,omitempty"` 662 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}, C: coverPtrMarshalJSON{}}, 663 }, 664 { 665 name: "HeadPtrMarshalJSONMultiFieldsString", 666 data: struct { 667 A coverPtrMarshalJSON `json:"a,string"` 668 B coverPtrMarshalJSON `json:"b,string"` 669 C coverPtrMarshalJSON `json:"c,string"` 670 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}, C: coverPtrMarshalJSON{}}, 671 }, 672 673 // HeadMarshalJSONPtrMultiFields 674 { 675 name: "HeadMarshalJSONPtrMultiFields", 676 data: struct { 677 A *coverMarshalJSON `json:"a"` 678 B *coverMarshalJSON `json:"b"` 679 C *coverMarshalJSON `json:"c"` 680 }{A: &coverMarshalJSON{}, B: &coverMarshalJSON{}, C: &coverMarshalJSON{}}, 681 }, 682 { 683 name: "HeadMarshalJSONPtrMultiFieldsOmitEmpty", 684 data: struct { 685 A *coverMarshalJSON `json:"a,omitempty"` 686 B *coverMarshalJSON `json:"b,omitempty"` 687 C *coverMarshalJSON `json:"c,omitempty"` 688 }{A: &coverMarshalJSON{}, B: &coverMarshalJSON{}, C: &coverMarshalJSON{}}, 689 }, 690 { 691 name: "HeadMarshalJSONPtrMultiFieldsString", 692 data: struct { 693 A *coverMarshalJSON `json:"a,string"` 694 B *coverMarshalJSON `json:"b,string"` 695 C *coverMarshalJSON `json:"c,string"` 696 }{A: &coverMarshalJSON{}, B: &coverMarshalJSON{}, C: &coverMarshalJSON{}}, 697 }, 698 { 699 name: "HeadPtrMarshalJSONPtrMultiFields", 700 data: struct { 701 A *coverPtrMarshalJSON `json:"a"` 702 B *coverPtrMarshalJSON `json:"b"` 703 C *coverPtrMarshalJSON `json:"c"` 704 }{A: &coverPtrMarshalJSON{}, B: &coverPtrMarshalJSON{}, C: &coverPtrMarshalJSON{}}, 705 }, 706 { 707 name: "HeadPtrMarshalJSONPtrMultiFieldsOmitEmpty", 708 data: struct { 709 A *coverPtrMarshalJSON `json:"a,omitempty"` 710 B *coverPtrMarshalJSON `json:"b,omitempty"` 711 C *coverPtrMarshalJSON `json:"c,omitempty"` 712 }{A: &coverPtrMarshalJSON{}, B: &coverPtrMarshalJSON{}, C: &coverPtrMarshalJSON{}}, 713 }, 714 { 715 name: "HeadPtrMarshalJSONPtrMultiFieldsString", 716 data: struct { 717 A *coverPtrMarshalJSON `json:"a,string"` 718 B *coverPtrMarshalJSON `json:"b,string"` 719 C *coverPtrMarshalJSON `json:"c,string"` 720 }{A: &coverPtrMarshalJSON{}, B: &coverPtrMarshalJSON{}, C: &coverPtrMarshalJSON{}}, 721 }, 722 723 // HeadMarshalJSONPtrNilMultiFields 724 { 725 name: "HeadMarshalJSONPtrNilMultiFields", 726 data: struct { 727 A *coverMarshalJSON `json:"a"` 728 B *coverMarshalJSON `json:"b"` 729 C *coverMarshalJSON `json:"c"` 730 }{A: nil, B: nil, C: nil}, 731 }, 732 { 733 name: "HeadMarshalJSONPtrNilMultiFieldsOmitEmpty", 734 data: struct { 735 A *coverMarshalJSON `json:"a,omitempty"` 736 B *coverMarshalJSON `json:"b,omitempty"` 737 C *coverMarshalJSON `json:"c,omitempty"` 738 }{A: nil, B: nil, C: nil}, 739 }, 740 { 741 name: "HeadMarshalJSONPtrNilMultiFieldsString", 742 data: struct { 743 A *coverMarshalJSON `json:"a,string"` 744 B *coverMarshalJSON `json:"b,string"` 745 C *coverMarshalJSON `json:"c,string"` 746 }{A: nil, B: nil, C: nil}, 747 }, 748 { 749 name: "HeadPtrMarshalJSONPtrNilMultiFields", 750 data: struct { 751 A *coverPtrMarshalJSON `json:"a"` 752 B *coverPtrMarshalJSON `json:"b"` 753 C *coverPtrMarshalJSON `json:"c"` 754 }{A: nil, B: nil, C: nil}, 755 }, 756 { 757 name: "HeadPtrMarshalJSONPtrNilMultiFieldsOmitEmpty", 758 data: struct { 759 A *coverPtrMarshalJSON `json:"a,omitempty"` 760 B *coverPtrMarshalJSON `json:"b,omitempty"` 761 C *coverPtrMarshalJSON `json:"c,omitempty"` 762 }{A: nil, B: nil, C: nil}, 763 }, 764 { 765 name: "HeadPtrMarshalJSONPtrNilMultiFieldsString", 766 data: struct { 767 A *coverPtrMarshalJSON `json:"a,string"` 768 B *coverPtrMarshalJSON `json:"b,string"` 769 C *coverPtrMarshalJSON `json:"c,string"` 770 }{A: nil, B: nil, C: nil}, 771 }, 772 773 // PtrHeadMarshalJSONZeroMultiFields 774 { 775 name: "PtrHeadMarshalJSONZeroMultiFields", 776 data: &struct { 777 A coverMarshalJSON `json:"a"` 778 B coverMarshalJSON `json:"b"` 779 }{}, 780 }, 781 { 782 name: "PtrHeadMarshalJSONZeroMultiFieldsOmitEmpty", 783 data: &struct { 784 A coverMarshalJSON `json:"a,omitempty"` 785 B coverMarshalJSON `json:"b,omitempty"` 786 }{}, 787 }, 788 { 789 name: "PtrHeadMarshalJSONZeroMultiFieldsString", 790 data: &struct { 791 A coverMarshalJSON `json:"a,string"` 792 B coverMarshalJSON `json:"b,string"` 793 }{}, 794 }, 795 { 796 name: "PtrHeadPtrMarshalJSONZeroMultiFields", 797 data: &struct { 798 A coverPtrMarshalJSON `json:"a"` 799 B coverPtrMarshalJSON `json:"b"` 800 }{}, 801 }, 802 { 803 name: "PtrHeadPtrMarshalJSONZeroMultiFieldsOmitEmpty", 804 data: &struct { 805 A coverPtrMarshalJSON `json:"a,omitempty"` 806 B coverPtrMarshalJSON `json:"b,omitempty"` 807 }{}, 808 }, 809 { 810 name: "PtrHeadPtrMarshalJSONZeroMultiFieldsString", 811 data: &struct { 812 A coverPtrMarshalJSON `json:"a,string"` 813 B coverPtrMarshalJSON `json:"b,string"` 814 }{}, 815 }, 816 817 // PtrHeadMarshalJSONMultiFields 818 { 819 name: "PtrHeadMarshalJSONMultiFields", 820 data: &struct { 821 A coverMarshalJSON `json:"a"` 822 B coverMarshalJSON `json:"b"` 823 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}}, 824 }, 825 { 826 name: "PtrHeadMarshalJSONMultiFieldsOmitEmpty", 827 data: &struct { 828 A coverMarshalJSON `json:"a,omitempty"` 829 B coverMarshalJSON `json:"b,omitempty"` 830 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}}, 831 }, 832 { 833 name: "PtrHeadMarshalJSONMultiFieldsString", 834 data: &struct { 835 A coverMarshalJSON `json:"a,string"` 836 B coverMarshalJSON `json:"b,string"` 837 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}}, 838 }, 839 { 840 name: "PtrHeadPtrMarshalJSONMultiFields", 841 data: &struct { 842 A coverPtrMarshalJSON `json:"a"` 843 B coverPtrMarshalJSON `json:"b"` 844 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}}, 845 }, 846 { 847 name: "PtrHeadPtrMarshalJSONMultiFieldsOmitEmpty", 848 data: &struct { 849 A coverPtrMarshalJSON `json:"a,omitempty"` 850 B coverPtrMarshalJSON `json:"b,omitempty"` 851 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}}, 852 }, 853 { 854 name: "PtrHeadPtrMarshalJSONMultiFieldsString", 855 data: &struct { 856 A coverPtrMarshalJSON `json:"a,string"` 857 B coverPtrMarshalJSON `json:"b,string"` 858 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}}, 859 }, 860 861 // PtrHeadMarshalJSONPtrMultiFields 862 { 863 name: "PtrHeadMarshalJSONPtrMultiFields", 864 data: &struct { 865 A *coverMarshalJSON `json:"a"` 866 B *coverMarshalJSON `json:"b"` 867 }{A: &coverMarshalJSON{}, B: &coverMarshalJSON{}}, 868 }, 869 { 870 name: "PtrHeadMarshalJSONPtrMultiFieldsOmitEmpty", 871 data: &struct { 872 A *coverMarshalJSON `json:"a,omitempty"` 873 B *coverMarshalJSON `json:"b,omitempty"` 874 }{A: &coverMarshalJSON{}, B: &coverMarshalJSON{}}, 875 }, 876 { 877 name: "PtrHeadMarshalJSONPtrMultiFieldsString", 878 data: &struct { 879 A *coverMarshalJSON `json:"a,string"` 880 B *coverMarshalJSON `json:"b,string"` 881 }{A: &coverMarshalJSON{}, B: &coverMarshalJSON{}}, 882 }, 883 { 884 name: "PtrHeadPtrMarshalJSONPtrMultiFields", 885 data: &struct { 886 A *coverPtrMarshalJSON `json:"a"` 887 B *coverPtrMarshalJSON `json:"b"` 888 }{A: &coverPtrMarshalJSON{}, B: &coverPtrMarshalJSON{}}, 889 }, 890 { 891 name: "PtrHeadPtrMarshalJSONPtrMultiFieldsOmitEmpty", 892 data: &struct { 893 A *coverPtrMarshalJSON `json:"a,omitempty"` 894 B *coverPtrMarshalJSON `json:"b,omitempty"` 895 }{A: &coverPtrMarshalJSON{}, B: &coverPtrMarshalJSON{}}, 896 }, 897 { 898 name: "PtrHeadPtrMarshalJSONPtrMultiFieldsString", 899 data: &struct { 900 A *coverPtrMarshalJSON `json:"a,string"` 901 B *coverPtrMarshalJSON `json:"b,string"` 902 }{A: &coverPtrMarshalJSON{}, B: &coverPtrMarshalJSON{}}, 903 }, 904 905 // PtrHeadMarshalJSONPtrNilMultiFields 906 { 907 name: "PtrHeadMarshalJSONPtrNilMultiFields", 908 data: &struct { 909 A *coverMarshalJSON `json:"a"` 910 B *coverMarshalJSON `json:"b"` 911 }{A: nil, B: nil}, 912 }, 913 { 914 name: "PtrHeadMarshalJSONPtrNilMultiFieldsOmitEmpty", 915 data: &struct { 916 A *coverMarshalJSON `json:"a,omitempty"` 917 B *coverMarshalJSON `json:"b,omitempty"` 918 }{A: nil, B: nil}, 919 }, 920 { 921 name: "PtrHeadMarshalJSONPtrNilMultiFieldsString", 922 data: &struct { 923 A *coverMarshalJSON `json:"a,string"` 924 B *coverMarshalJSON `json:"b,string"` 925 }{A: nil, B: nil}, 926 }, 927 { 928 name: "PtrHeadPtrMarshalJSONPtrNilMultiFields", 929 data: &struct { 930 A *coverPtrMarshalJSON `json:"a"` 931 B *coverPtrMarshalJSON `json:"b"` 932 }{A: nil, B: nil}, 933 }, 934 { 935 name: "PtrHeadPtrMarshalJSONPtrNilMultiFieldsOmitEmpty", 936 data: &struct { 937 A *coverPtrMarshalJSON `json:"a,omitempty"` 938 B *coverPtrMarshalJSON `json:"b,omitempty"` 939 }{A: nil, B: nil}, 940 }, 941 { 942 name: "PtrHeadPtrMarshalJSONPtrNilMultiFieldsString", 943 data: &struct { 944 A *coverPtrMarshalJSON `json:"a,string"` 945 B *coverPtrMarshalJSON `json:"b,string"` 946 }{A: nil, B: nil}, 947 }, 948 949 // PtrHeadMarshalJSONNilMultiFields 950 { 951 name: "PtrHeadMarshalJSONNilMultiFields", 952 data: (*struct { 953 A coverMarshalJSON `json:"a"` 954 B coverMarshalJSON `json:"b"` 955 })(nil), 956 }, 957 { 958 name: "PtrHeadMarshalJSONNilMultiFieldsOmitEmpty", 959 data: (*struct { 960 A coverMarshalJSON `json:"a,omitempty"` 961 B coverMarshalJSON `json:"b,omitempty"` 962 })(nil), 963 }, 964 { 965 name: "PtrHeadMarshalJSONNilMultiFieldsString", 966 data: (*struct { 967 A coverMarshalJSON `json:"a,string"` 968 B coverMarshalJSON `json:"b,string"` 969 })(nil), 970 }, 971 { 972 name: "PtrHeadPtrMarshalJSONNilMultiFields", 973 data: (*struct { 974 A coverPtrMarshalJSON `json:"a"` 975 B coverPtrMarshalJSON `json:"b"` 976 })(nil), 977 }, 978 { 979 name: "PtrHeadPtrMarshalJSONNilMultiFieldsOmitEmpty", 980 data: (*struct { 981 A coverPtrMarshalJSON `json:"a,omitempty"` 982 B coverPtrMarshalJSON `json:"b,omitempty"` 983 })(nil), 984 }, 985 { 986 name: "PtrHeadPtrMarshalJSONNilMultiFieldsString", 987 data: (*struct { 988 A coverPtrMarshalJSON `json:"a,string"` 989 B coverPtrMarshalJSON `json:"b,string"` 990 })(nil), 991 }, 992 993 // PtrHeadMarshalJSONNilMultiFields 994 { 995 name: "PtrHeadMarshalJSONNilMultiFields", 996 data: (*struct { 997 A *coverMarshalJSON `json:"a"` 998 B *coverMarshalJSON `json:"b"` 999 })(nil), 1000 }, 1001 { 1002 name: "PtrHeadMarshalJSONNilMultiFieldsOmitEmpty", 1003 data: (*struct { 1004 A *coverMarshalJSON `json:"a,omitempty"` 1005 B *coverMarshalJSON `json:"b,omitempty"` 1006 })(nil), 1007 }, 1008 { 1009 name: "PtrHeadMarshalJSONNilMultiFieldsString", 1010 data: (*struct { 1011 A *coverMarshalJSON `json:"a,string"` 1012 B *coverMarshalJSON `json:"b,string"` 1013 })(nil), 1014 }, 1015 { 1016 name: "PtrHeadPtrMarshalJSONNilMultiFields", 1017 data: (*struct { 1018 A *coverPtrMarshalJSON `json:"a"` 1019 B *coverPtrMarshalJSON `json:"b"` 1020 })(nil), 1021 }, 1022 { 1023 name: "PtrHeadPtrMarshalJSONNilMultiFieldsOmitEmpty", 1024 data: (*struct { 1025 A *coverPtrMarshalJSON `json:"a,omitempty"` 1026 B *coverPtrMarshalJSON `json:"b,omitempty"` 1027 })(nil), 1028 }, 1029 { 1030 name: "PtrHeadPtrMarshalJSONNilMultiFieldsString", 1031 data: (*struct { 1032 A *coverPtrMarshalJSON `json:"a,string"` 1033 B *coverPtrMarshalJSON `json:"b,string"` 1034 })(nil), 1035 }, 1036 1037 // HeadMarshalJSONZeroNotRoot 1038 { 1039 name: "HeadMarshalJSONZeroNotRoot", 1040 data: struct { 1041 A struct { 1042 A coverMarshalJSON `json:"a"` 1043 } 1044 }{}, 1045 }, 1046 { 1047 name: "HeadMarshalJSONZeroNotRootOmitEmpty", 1048 data: struct { 1049 A struct { 1050 A coverMarshalJSON `json:"a,omitempty"` 1051 } 1052 }{}, 1053 }, 1054 { 1055 name: "HeadMarshalJSONZeroNotRootString", 1056 data: struct { 1057 A struct { 1058 A coverMarshalJSON `json:"a,string"` 1059 } 1060 }{}, 1061 }, 1062 { 1063 name: "HeadPtrMarshalJSONZeroNotRoot", 1064 data: struct { 1065 A struct { 1066 A coverPtrMarshalJSON `json:"a"` 1067 } 1068 }{}, 1069 }, 1070 { 1071 name: "HeadPtrMarshalJSONZeroNotRootOmitEmpty", 1072 data: struct { 1073 A struct { 1074 A coverPtrMarshalJSON `json:"a,omitempty"` 1075 } 1076 }{}, 1077 }, 1078 { 1079 name: "HeadPtrMarshalJSONZeroNotRootString", 1080 data: struct { 1081 A struct { 1082 A coverPtrMarshalJSON `json:"a,string"` 1083 } 1084 }{}, 1085 }, 1086 1087 // HeadMarshalJSONNotRoot 1088 { 1089 name: "HeadMarshalJSONNotRoot", 1090 data: struct { 1091 A struct { 1092 A coverMarshalJSON `json:"a"` 1093 } 1094 }{A: struct { 1095 A coverMarshalJSON `json:"a"` 1096 }{A: coverMarshalJSON{}}}, 1097 }, 1098 { 1099 name: "HeadMarshalJSONNotRootOmitEmpty", 1100 data: struct { 1101 A struct { 1102 A coverMarshalJSON `json:"a,omitempty"` 1103 } 1104 }{A: struct { 1105 A coverMarshalJSON `json:"a,omitempty"` 1106 }{A: coverMarshalJSON{}}}, 1107 }, 1108 { 1109 name: "HeadMarshalJSONNotRootString", 1110 data: struct { 1111 A struct { 1112 A coverMarshalJSON `json:"a,string"` 1113 } 1114 }{A: struct { 1115 A coverMarshalJSON `json:"a,string"` 1116 }{A: coverMarshalJSON{}}}, 1117 }, 1118 { 1119 name: "HeadMarshalJSONNotRoot", 1120 data: struct { 1121 A struct { 1122 A coverPtrMarshalJSON `json:"a"` 1123 } 1124 }{A: struct { 1125 A coverPtrMarshalJSON `json:"a"` 1126 }{A: coverPtrMarshalJSON{}}}, 1127 }, 1128 { 1129 name: "HeadMarshalJSONNotRootOmitEmpty", 1130 data: struct { 1131 A struct { 1132 A coverPtrMarshalJSON `json:"a,omitempty"` 1133 } 1134 }{A: struct { 1135 A coverPtrMarshalJSON `json:"a,omitempty"` 1136 }{A: coverPtrMarshalJSON{}}}, 1137 }, 1138 { 1139 name: "HeadMarshalJSONNotRootString", 1140 data: struct { 1141 A struct { 1142 A coverPtrMarshalJSON `json:"a,string"` 1143 } 1144 }{A: struct { 1145 A coverPtrMarshalJSON `json:"a,string"` 1146 }{A: coverPtrMarshalJSON{}}}, 1147 }, 1148 1149 // HeadMarshalJSONPtrNotRoot 1150 { 1151 name: "HeadMarshalJSONPtrNotRoot", 1152 data: struct { 1153 A struct { 1154 A *coverMarshalJSON `json:"a"` 1155 } 1156 }{A: struct { 1157 A *coverMarshalJSON `json:"a"` 1158 }{&coverMarshalJSON{}}}, 1159 }, 1160 { 1161 name: "HeadMarshalJSONPtrNotRootOmitEmpty", 1162 data: struct { 1163 A struct { 1164 A *coverMarshalJSON `json:"a,omitempty"` 1165 } 1166 }{A: struct { 1167 A *coverMarshalJSON `json:"a,omitempty"` 1168 }{&coverMarshalJSON{}}}, 1169 }, 1170 { 1171 name: "HeadMarshalJSONPtrNotRootString", 1172 data: struct { 1173 A struct { 1174 A *coverMarshalJSON `json:"a,string"` 1175 } 1176 }{A: struct { 1177 A *coverMarshalJSON `json:"a,string"` 1178 }{&coverMarshalJSON{}}}, 1179 }, 1180 { 1181 name: "HeadPtrMarshalJSONPtrNotRoot", 1182 data: struct { 1183 A struct { 1184 A *coverPtrMarshalJSON `json:"a"` 1185 } 1186 }{A: struct { 1187 A *coverPtrMarshalJSON `json:"a"` 1188 }{&coverPtrMarshalJSON{}}}, 1189 }, 1190 { 1191 name: "HeadPtrMarshalJSONPtrNotRootOmitEmpty", 1192 data: struct { 1193 A struct { 1194 A *coverPtrMarshalJSON `json:"a,omitempty"` 1195 } 1196 }{A: struct { 1197 A *coverPtrMarshalJSON `json:"a,omitempty"` 1198 }{&coverPtrMarshalJSON{}}}, 1199 }, 1200 { 1201 name: "HeadPtrMarshalJSONPtrNotRootString", 1202 data: struct { 1203 A struct { 1204 A *coverPtrMarshalJSON `json:"a,string"` 1205 } 1206 }{A: struct { 1207 A *coverPtrMarshalJSON `json:"a,string"` 1208 }{&coverPtrMarshalJSON{}}}, 1209 }, 1210 1211 // HeadMarshalJSONPtrNilNotRoot 1212 { 1213 name: "HeadMarshalJSONPtrNilNotRoot", 1214 data: struct { 1215 A struct { 1216 A *coverMarshalJSON `json:"a"` 1217 } 1218 }{}, 1219 }, 1220 { 1221 name: "HeadMarshalJSONPtrNilNotRootOmitEmpty", 1222 data: struct { 1223 A struct { 1224 A *coverMarshalJSON `json:"a,omitempty"` 1225 } 1226 }{}, 1227 }, 1228 { 1229 name: "HeadMarshalJSONPtrNilNotRootString", 1230 data: struct { 1231 A struct { 1232 A *coverMarshalJSON `json:"a,string"` 1233 } 1234 }{}, 1235 }, 1236 { 1237 name: "HeadPtrMarshalJSONPtrNilNotRoot", 1238 data: struct { 1239 A struct { 1240 A *coverPtrMarshalJSON `json:"a"` 1241 } 1242 }{}, 1243 }, 1244 { 1245 name: "HeadPtrMarshalJSONPtrNilNotRootOmitEmpty", 1246 data: struct { 1247 A struct { 1248 A *coverPtrMarshalJSON `json:"a,omitempty"` 1249 } 1250 }{}, 1251 }, 1252 { 1253 name: "HeadPtrMarshalJSONPtrNilNotRootString", 1254 data: struct { 1255 A struct { 1256 A *coverPtrMarshalJSON `json:"a,string"` 1257 } 1258 }{}, 1259 }, 1260 1261 // PtrHeadMarshalJSONZeroNotRoot 1262 { 1263 name: "PtrHeadMarshalJSONZeroNotRoot", 1264 data: struct { 1265 A *struct { 1266 A coverMarshalJSON `json:"a"` 1267 } 1268 }{A: new(struct { 1269 A coverMarshalJSON `json:"a"` 1270 })}, 1271 }, 1272 { 1273 name: "PtrHeadMarshalJSONZeroNotRootOmitEmpty", 1274 data: struct { 1275 A *struct { 1276 A coverMarshalJSON `json:"a,omitempty"` 1277 } 1278 }{A: new(struct { 1279 A coverMarshalJSON `json:"a,omitempty"` 1280 })}, 1281 }, 1282 { 1283 name: "PtrHeadMarshalJSONZeroNotRootString", 1284 data: struct { 1285 A *struct { 1286 A coverMarshalJSON `json:"a,string"` 1287 } 1288 }{A: new(struct { 1289 A coverMarshalJSON `json:"a,string"` 1290 })}, 1291 }, 1292 { 1293 name: "PtrHeadPtrMarshalJSONZeroNotRoot", 1294 data: struct { 1295 A *struct { 1296 A coverPtrMarshalJSON `json:"a"` 1297 } 1298 }{A: new(struct { 1299 A coverPtrMarshalJSON `json:"a"` 1300 })}, 1301 }, 1302 { 1303 name: "PtrHeadPtrMarshalJSONZeroNotRootOmitEmpty", 1304 data: struct { 1305 A *struct { 1306 A coverPtrMarshalJSON `json:"a,omitempty"` 1307 } 1308 }{A: new(struct { 1309 A coverPtrMarshalJSON `json:"a,omitempty"` 1310 })}, 1311 }, 1312 { 1313 name: "PtrHeadPtrMarshalJSONZeroNotRootString", 1314 data: struct { 1315 A *struct { 1316 A coverPtrMarshalJSON `json:"a,string"` 1317 } 1318 }{A: new(struct { 1319 A coverPtrMarshalJSON `json:"a,string"` 1320 })}, 1321 }, 1322 1323 // PtrHeadMarshalJSONNotRoot 1324 { 1325 name: "PtrHeadMarshalJSONNotRoot", 1326 data: struct { 1327 A *struct { 1328 A coverMarshalJSON `json:"a"` 1329 } 1330 }{A: &(struct { 1331 A coverMarshalJSON `json:"a"` 1332 }{A: coverMarshalJSON{}})}, 1333 }, 1334 { 1335 name: "PtrHeadMarshalJSONNotRootOmitEmpty", 1336 data: struct { 1337 A *struct { 1338 A coverMarshalJSON `json:"a,omitempty"` 1339 } 1340 }{A: &(struct { 1341 A coverMarshalJSON `json:"a,omitempty"` 1342 }{A: coverMarshalJSON{}})}, 1343 }, 1344 { 1345 name: "PtrHeadMarshalJSONNotRootString", 1346 data: struct { 1347 A *struct { 1348 A coverMarshalJSON `json:"a,string"` 1349 } 1350 }{A: &(struct { 1351 A coverMarshalJSON `json:"a,string"` 1352 }{A: coverMarshalJSON{}})}, 1353 }, 1354 { 1355 name: "PtrHeadPtrMarshalJSONNotRoot", 1356 data: struct { 1357 A *struct { 1358 A coverPtrMarshalJSON `json:"a"` 1359 } 1360 }{A: &(struct { 1361 A coverPtrMarshalJSON `json:"a"` 1362 }{A: coverPtrMarshalJSON{}})}, 1363 }, 1364 { 1365 name: "PtrHeadPtrMarshalJSONNotRootOmitEmpty", 1366 data: struct { 1367 A *struct { 1368 A coverPtrMarshalJSON `json:"a,omitempty"` 1369 } 1370 }{A: &(struct { 1371 A coverPtrMarshalJSON `json:"a,omitempty"` 1372 }{A: coverPtrMarshalJSON{}})}, 1373 }, 1374 { 1375 name: "PtrHeadPtrMarshalJSONNotRootString", 1376 data: struct { 1377 A *struct { 1378 A coverPtrMarshalJSON `json:"a,string"` 1379 } 1380 }{A: &(struct { 1381 A coverPtrMarshalJSON `json:"a,string"` 1382 }{A: coverPtrMarshalJSON{}})}, 1383 }, 1384 1385 // PtrHeadMarshalJSONPtrNotRoot 1386 { 1387 name: "PtrHeadMarshalJSONPtrNotRoot", 1388 data: struct { 1389 A *struct { 1390 A *coverMarshalJSON `json:"a"` 1391 } 1392 }{A: &(struct { 1393 A *coverMarshalJSON `json:"a"` 1394 }{A: &coverMarshalJSON{}})}, 1395 }, 1396 { 1397 name: "PtrHeadMarshalJSONPtrNotRootOmitEmpty", 1398 data: struct { 1399 A *struct { 1400 A *coverMarshalJSON `json:"a,omitempty"` 1401 } 1402 }{A: &(struct { 1403 A *coverMarshalJSON `json:"a,omitempty"` 1404 }{A: &coverMarshalJSON{}})}, 1405 }, 1406 { 1407 name: "PtrHeadMarshalJSONPtrNotRootString", 1408 data: struct { 1409 A *struct { 1410 A *coverMarshalJSON `json:"a,string"` 1411 } 1412 }{A: &(struct { 1413 A *coverMarshalJSON `json:"a,string"` 1414 }{A: &coverMarshalJSON{}})}, 1415 }, 1416 { 1417 name: "PtrHeadPtrMarshalJSONPtrNotRoot", 1418 data: struct { 1419 A *struct { 1420 A *coverPtrMarshalJSON `json:"a"` 1421 } 1422 }{A: &(struct { 1423 A *coverPtrMarshalJSON `json:"a"` 1424 }{A: &coverPtrMarshalJSON{}})}, 1425 }, 1426 { 1427 name: "PtrHeadPtrMarshalJSONPtrNotRootOmitEmpty", 1428 data: struct { 1429 A *struct { 1430 A *coverPtrMarshalJSON `json:"a,omitempty"` 1431 } 1432 }{A: &(struct { 1433 A *coverPtrMarshalJSON `json:"a,omitempty"` 1434 }{A: &coverPtrMarshalJSON{}})}, 1435 }, 1436 { 1437 name: "PtrHeadPtrMarshalJSONPtrNotRootString", 1438 data: struct { 1439 A *struct { 1440 A *coverPtrMarshalJSON `json:"a,string"` 1441 } 1442 }{A: &(struct { 1443 A *coverPtrMarshalJSON `json:"a,string"` 1444 }{A: &coverPtrMarshalJSON{}})}, 1445 }, 1446 1447 // PtrHeadMarshalJSONPtrNilNotRoot 1448 { 1449 name: "PtrHeadMarshalJSONPtrNilNotRoot", 1450 data: struct { 1451 A *struct { 1452 A *coverMarshalJSON `json:"a"` 1453 } 1454 }{A: &(struct { 1455 A *coverMarshalJSON `json:"a"` 1456 }{A: nil})}, 1457 }, 1458 { 1459 name: "PtrHeadMarshalJSONPtrNilNotRootOmitEmpty", 1460 data: struct { 1461 A *struct { 1462 A *coverMarshalJSON `json:"a,omitempty"` 1463 } 1464 }{A: &(struct { 1465 A *coverMarshalJSON `json:"a,omitempty"` 1466 }{A: nil})}, 1467 }, 1468 { 1469 name: "PtrHeadMarshalJSONPtrNilNotRootString", 1470 data: struct { 1471 A *struct { 1472 A *coverMarshalJSON `json:"a,string"` 1473 } 1474 }{A: &(struct { 1475 A *coverMarshalJSON `json:"a,string"` 1476 }{A: nil})}, 1477 }, 1478 { 1479 name: "PtrHeadPtrMarshalJSONPtrNilNotRoot", 1480 data: struct { 1481 A *struct { 1482 A *coverPtrMarshalJSON `json:"a"` 1483 } 1484 }{A: &(struct { 1485 A *coverPtrMarshalJSON `json:"a"` 1486 }{A: nil})}, 1487 }, 1488 { 1489 name: "PtrHeadPtrMarshalJSONPtrNilNotRootOmitEmpty", 1490 data: struct { 1491 A *struct { 1492 A *coverPtrMarshalJSON `json:"a,omitempty"` 1493 } 1494 }{A: &(struct { 1495 A *coverPtrMarshalJSON `json:"a,omitempty"` 1496 }{A: nil})}, 1497 }, 1498 { 1499 name: "PtrHeadPtrMarshalJSONPtrNilNotRootString", 1500 data: struct { 1501 A *struct { 1502 A *coverPtrMarshalJSON `json:"a,string"` 1503 } 1504 }{A: &(struct { 1505 A *coverPtrMarshalJSON `json:"a,string"` 1506 }{A: nil})}, 1507 }, 1508 1509 // PtrHeadMarshalJSONNilNotRoot 1510 { 1511 name: "PtrHeadMarshalJSONNilNotRoot", 1512 data: struct { 1513 A *struct { 1514 A *coverMarshalJSON `json:"a"` 1515 } 1516 }{A: nil}, 1517 }, 1518 { 1519 name: "PtrHeadMarshalJSONNilNotRootOmitEmpty", 1520 data: struct { 1521 A *struct { 1522 A *coverMarshalJSON `json:"a,omitempty"` 1523 } `json:",omitempty"` 1524 }{A: nil}, 1525 }, 1526 { 1527 name: "PtrHeadMarshalJSONNilNotRootString", 1528 data: struct { 1529 A *struct { 1530 A *coverMarshalJSON `json:"a,string"` 1531 } `json:",string"` 1532 }{A: nil}, 1533 }, 1534 { 1535 name: "PtrHeadPtrMarshalJSONNilNotRoot", 1536 data: struct { 1537 A *struct { 1538 A *coverPtrMarshalJSON `json:"a"` 1539 } 1540 }{A: nil}, 1541 }, 1542 { 1543 name: "PtrHeadPtrMarshalJSONNilNotRootOmitEmpty", 1544 data: struct { 1545 A *struct { 1546 A *coverPtrMarshalJSON `json:"a,omitempty"` 1547 } `json:",omitempty"` 1548 }{A: nil}, 1549 }, 1550 { 1551 name: "PtrHeadPtrMarshalJSONNilNotRootString", 1552 data: struct { 1553 A *struct { 1554 A *coverPtrMarshalJSON `json:"a,string"` 1555 } `json:",string"` 1556 }{A: nil}, 1557 }, 1558 1559 // HeadMarshalJSONZeroMultiFieldsNotRoot 1560 { 1561 name: "HeadMarshalJSONZeroMultiFieldsNotRoot", 1562 data: struct { 1563 A struct { 1564 A coverMarshalJSON `json:"a"` 1565 } 1566 B struct { 1567 B coverMarshalJSON `json:"b"` 1568 } 1569 }{}, 1570 }, 1571 { 1572 name: "HeadMarshalJSONZeroMultiFieldsNotRootOmitEmpty", 1573 data: struct { 1574 A struct { 1575 A coverMarshalJSON `json:"a,omitempty"` 1576 } 1577 B struct { 1578 B coverMarshalJSON `json:"b,omitempty"` 1579 } 1580 }{}, 1581 }, 1582 { 1583 name: "HeadMarshalJSONZeroMultiFieldsNotRootString", 1584 data: struct { 1585 A struct { 1586 A coverMarshalJSON `json:"a,string"` 1587 } 1588 B struct { 1589 B coverMarshalJSON `json:"b,string"` 1590 } 1591 }{}, 1592 }, 1593 { 1594 name: "HeadPtrMarshalJSONZeroMultiFieldsNotRoot", 1595 data: struct { 1596 A struct { 1597 A coverPtrMarshalJSON `json:"a"` 1598 } 1599 B struct { 1600 B coverPtrMarshalJSON `json:"b"` 1601 } 1602 }{}, 1603 }, 1604 { 1605 name: "HeadPtrMarshalJSONZeroMultiFieldsNotRootOmitEmpty", 1606 data: struct { 1607 A struct { 1608 A coverPtrMarshalJSON `json:"a,omitempty"` 1609 } 1610 B struct { 1611 B coverPtrMarshalJSON `json:"b,omitempty"` 1612 } 1613 }{}, 1614 }, 1615 { 1616 name: "HeadPtrMarshalJSONZeroMultiFieldsNotRootString", 1617 data: struct { 1618 A struct { 1619 A coverPtrMarshalJSON `json:"a,string"` 1620 } 1621 B struct { 1622 B coverPtrMarshalJSON `json:"b,string"` 1623 } 1624 }{}, 1625 }, 1626 1627 // HeadMarshalJSONMultiFieldsNotRoot 1628 { 1629 name: "HeadMarshalJSONMultiFieldsNotRoot", 1630 data: struct { 1631 A struct { 1632 A coverMarshalJSON `json:"a"` 1633 } 1634 B struct { 1635 B coverMarshalJSON `json:"b"` 1636 } 1637 }{A: struct { 1638 A coverMarshalJSON `json:"a"` 1639 }{A: coverMarshalJSON{}}, B: struct { 1640 B coverMarshalJSON `json:"b"` 1641 }{B: coverMarshalJSON{}}}, 1642 }, 1643 { 1644 name: "HeadMarshalJSONMultiFieldsNotRootOmitEmpty", 1645 data: struct { 1646 A struct { 1647 A coverMarshalJSON `json:"a,omitempty"` 1648 } 1649 B struct { 1650 B coverMarshalJSON `json:"b,omitempty"` 1651 } 1652 }{A: struct { 1653 A coverMarshalJSON `json:"a,omitempty"` 1654 }{A: coverMarshalJSON{}}, B: struct { 1655 B coverMarshalJSON `json:"b,omitempty"` 1656 }{B: coverMarshalJSON{}}}, 1657 }, 1658 { 1659 name: "HeadMarshalJSONMultiFieldsNotRootString", 1660 data: struct { 1661 A struct { 1662 A coverMarshalJSON `json:"a,string"` 1663 } 1664 B struct { 1665 B coverMarshalJSON `json:"b,string"` 1666 } 1667 }{A: struct { 1668 A coverMarshalJSON `json:"a,string"` 1669 }{A: coverMarshalJSON{}}, B: struct { 1670 B coverMarshalJSON `json:"b,string"` 1671 }{B: coverMarshalJSON{}}}, 1672 }, 1673 { 1674 name: "HeadPtrMarshalJSONMultiFieldsNotRoot", 1675 data: struct { 1676 A struct { 1677 A coverPtrMarshalJSON `json:"a"` 1678 } 1679 B struct { 1680 B coverPtrMarshalJSON `json:"b"` 1681 } 1682 }{A: struct { 1683 A coverPtrMarshalJSON `json:"a"` 1684 }{A: coverPtrMarshalJSON{}}, B: struct { 1685 B coverPtrMarshalJSON `json:"b"` 1686 }{B: coverPtrMarshalJSON{}}}, 1687 }, 1688 { 1689 name: "HeadPtrMarshalJSONMultiFieldsNotRootOmitEmpty", 1690 data: struct { 1691 A struct { 1692 A coverPtrMarshalJSON `json:"a,omitempty"` 1693 } 1694 B struct { 1695 B coverPtrMarshalJSON `json:"b,omitempty"` 1696 } 1697 }{A: struct { 1698 A coverPtrMarshalJSON `json:"a,omitempty"` 1699 }{A: coverPtrMarshalJSON{}}, B: struct { 1700 B coverPtrMarshalJSON `json:"b,omitempty"` 1701 }{B: coverPtrMarshalJSON{}}}, 1702 }, 1703 { 1704 name: "HeadPtrMarshalJSONMultiFieldsNotRootString", 1705 data: struct { 1706 A struct { 1707 A coverPtrMarshalJSON `json:"a,string"` 1708 } 1709 B struct { 1710 B coverPtrMarshalJSON `json:"b,string"` 1711 } 1712 }{A: struct { 1713 A coverPtrMarshalJSON `json:"a,string"` 1714 }{A: coverPtrMarshalJSON{}}, B: struct { 1715 B coverPtrMarshalJSON `json:"b,string"` 1716 }{B: coverPtrMarshalJSON{}}}, 1717 }, 1718 1719 // HeadMarshalJSONPtrMultiFieldsNotRoot 1720 { 1721 name: "HeadMarshalJSONPtrMultiFieldsNotRoot", 1722 data: struct { 1723 A struct { 1724 A *coverMarshalJSON `json:"a"` 1725 } 1726 B struct { 1727 B *coverMarshalJSON `json:"b"` 1728 } 1729 }{A: struct { 1730 A *coverMarshalJSON `json:"a"` 1731 }{A: &coverMarshalJSON{}}, B: struct { 1732 B *coverMarshalJSON `json:"b"` 1733 }{B: &coverMarshalJSON{}}}, 1734 }, 1735 { 1736 name: "HeadMarshalJSONPtrMultiFieldsNotRootOmitEmpty", 1737 data: struct { 1738 A struct { 1739 A *coverMarshalJSON `json:"a,omitempty"` 1740 } 1741 B struct { 1742 B *coverMarshalJSON `json:"b,omitempty"` 1743 } 1744 }{A: struct { 1745 A *coverMarshalJSON `json:"a,omitempty"` 1746 }{A: &coverMarshalJSON{}}, B: struct { 1747 B *coverMarshalJSON `json:"b,omitempty"` 1748 }{B: &coverMarshalJSON{}}}, 1749 }, 1750 { 1751 name: "HeadMarshalJSONPtrMultiFieldsNotRootString", 1752 data: struct { 1753 A struct { 1754 A *coverMarshalJSON `json:"a,string"` 1755 } 1756 B struct { 1757 B *coverMarshalJSON `json:"b,string"` 1758 } 1759 }{A: struct { 1760 A *coverMarshalJSON `json:"a,string"` 1761 }{A: &coverMarshalJSON{}}, B: struct { 1762 B *coverMarshalJSON `json:"b,string"` 1763 }{B: &coverMarshalJSON{}}}, 1764 }, 1765 { 1766 name: "HeadPtrMarshalJSONPtrMultiFieldsNotRoot", 1767 data: struct { 1768 A struct { 1769 A *coverPtrMarshalJSON `json:"a"` 1770 } 1771 B struct { 1772 B *coverPtrMarshalJSON `json:"b"` 1773 } 1774 }{A: struct { 1775 A *coverPtrMarshalJSON `json:"a"` 1776 }{A: &coverPtrMarshalJSON{}}, B: struct { 1777 B *coverPtrMarshalJSON `json:"b"` 1778 }{B: &coverPtrMarshalJSON{}}}, 1779 }, 1780 { 1781 name: "HeadPtrMarshalJSONPtrMultiFieldsNotRootOmitEmpty", 1782 data: struct { 1783 A struct { 1784 A *coverPtrMarshalJSON `json:"a,omitempty"` 1785 } 1786 B struct { 1787 B *coverPtrMarshalJSON `json:"b,omitempty"` 1788 } 1789 }{A: struct { 1790 A *coverPtrMarshalJSON `json:"a,omitempty"` 1791 }{A: &coverPtrMarshalJSON{}}, B: struct { 1792 B *coverPtrMarshalJSON `json:"b,omitempty"` 1793 }{B: &coverPtrMarshalJSON{}}}, 1794 }, 1795 { 1796 name: "HeadPtrMarshalJSONPtrMultiFieldsNotRootString", 1797 data: struct { 1798 A struct { 1799 A *coverPtrMarshalJSON `json:"a,string"` 1800 } 1801 B struct { 1802 B *coverPtrMarshalJSON `json:"b,string"` 1803 } 1804 }{A: struct { 1805 A *coverPtrMarshalJSON `json:"a,string"` 1806 }{A: &coverPtrMarshalJSON{}}, B: struct { 1807 B *coverPtrMarshalJSON `json:"b,string"` 1808 }{B: &coverPtrMarshalJSON{}}}, 1809 }, 1810 1811 // HeadMarshalJSONPtrNilMultiFieldsNotRoot 1812 { 1813 name: "HeadMarshalJSONPtrNilMultiFieldsNotRoot", 1814 data: struct { 1815 A struct { 1816 A *coverMarshalJSON `json:"a"` 1817 } 1818 B struct { 1819 B *coverMarshalJSON `json:"b"` 1820 } 1821 }{A: struct { 1822 A *coverMarshalJSON `json:"a"` 1823 }{A: nil}, B: struct { 1824 B *coverMarshalJSON `json:"b"` 1825 }{B: nil}}, 1826 }, 1827 { 1828 name: "HeadMarshalJSONPtrNilMultiFieldsNotRootOmitEmpty", 1829 data: struct { 1830 A struct { 1831 A *coverMarshalJSON `json:"a,omitempty"` 1832 } 1833 B struct { 1834 B *coverMarshalJSON `json:"b,omitempty"` 1835 } 1836 }{A: struct { 1837 A *coverMarshalJSON `json:"a,omitempty"` 1838 }{A: nil}, B: struct { 1839 B *coverMarshalJSON `json:"b,omitempty"` 1840 }{B: nil}}, 1841 }, 1842 { 1843 name: "HeadMarshalJSONPtrNilMultiFieldsNotRootString", 1844 data: struct { 1845 A struct { 1846 A *coverMarshalJSON `json:"a,string"` 1847 } 1848 B struct { 1849 B *coverMarshalJSON `json:"b,string"` 1850 } 1851 }{A: struct { 1852 A *coverMarshalJSON `json:"a,string"` 1853 }{A: nil}, B: struct { 1854 B *coverMarshalJSON `json:"b,string"` 1855 }{B: nil}}, 1856 }, 1857 { 1858 name: "HeadPtrMarshalJSONPtrNilMultiFieldsNotRoot", 1859 data: struct { 1860 A struct { 1861 A *coverPtrMarshalJSON `json:"a"` 1862 } 1863 B struct { 1864 B *coverPtrMarshalJSON `json:"b"` 1865 } 1866 }{A: struct { 1867 A *coverPtrMarshalJSON `json:"a"` 1868 }{A: nil}, B: struct { 1869 B *coverPtrMarshalJSON `json:"b"` 1870 }{B: nil}}, 1871 }, 1872 { 1873 name: "HeadPtrMarshalJSONPtrNilMultiFieldsNotRootOmitEmpty", 1874 data: struct { 1875 A struct { 1876 A *coverPtrMarshalJSON `json:"a,omitempty"` 1877 } 1878 B struct { 1879 B *coverPtrMarshalJSON `json:"b,omitempty"` 1880 } 1881 }{A: struct { 1882 A *coverPtrMarshalJSON `json:"a,omitempty"` 1883 }{A: nil}, B: struct { 1884 B *coverPtrMarshalJSON `json:"b,omitempty"` 1885 }{B: nil}}, 1886 }, 1887 { 1888 name: "HeadPtrMarshalJSONPtrNilMultiFieldsNotRootString", 1889 data: struct { 1890 A struct { 1891 A *coverPtrMarshalJSON `json:"a,string"` 1892 } 1893 B struct { 1894 B *coverPtrMarshalJSON `json:"b,string"` 1895 } 1896 }{A: struct { 1897 A *coverPtrMarshalJSON `json:"a,string"` 1898 }{A: nil}, B: struct { 1899 B *coverPtrMarshalJSON `json:"b,string"` 1900 }{B: nil}}, 1901 }, 1902 1903 // PtrHeadMarshalJSONZeroMultiFieldsNotRoot 1904 { 1905 name: "PtrHeadMarshalJSONZeroMultiFieldsNotRoot", 1906 data: &struct { 1907 A struct { 1908 A coverMarshalJSON `json:"a"` 1909 } 1910 B struct { 1911 B coverMarshalJSON `json:"b"` 1912 } 1913 }{}, 1914 }, 1915 { 1916 name: "PtrHeadMarshalJSONZeroMultiFieldsNotRootOmitEmpty", 1917 data: &struct { 1918 A struct { 1919 A coverMarshalJSON `json:"a,omitempty"` 1920 } 1921 B struct { 1922 B coverMarshalJSON `json:"b,omitempty"` 1923 } 1924 }{}, 1925 }, 1926 { 1927 name: "PtrHeadMarshalJSONZeroMultiFieldsNotRootString", 1928 data: &struct { 1929 A struct { 1930 A coverMarshalJSON `json:"a,string"` 1931 } 1932 B struct { 1933 B coverMarshalJSON `json:"b,string"` 1934 } 1935 }{}, 1936 }, 1937 { 1938 name: "PtrHeadPtrMarshalJSONZeroMultiFieldsNotRoot", 1939 data: &struct { 1940 A struct { 1941 A coverPtrMarshalJSON `json:"a"` 1942 } 1943 B struct { 1944 B coverPtrMarshalJSON `json:"b"` 1945 } 1946 }{}, 1947 }, 1948 { 1949 name: "PtrHeadPtrMarshalJSONZeroMultiFieldsNotRootOmitEmpty", 1950 data: &struct { 1951 A struct { 1952 A coverPtrMarshalJSON `json:"a,omitempty"` 1953 } 1954 B struct { 1955 B coverPtrMarshalJSON `json:"b,omitempty"` 1956 } 1957 }{}, 1958 }, 1959 { 1960 name: "PtrHeadPtrMarshalJSONZeroMultiFieldsNotRootString", 1961 data: &struct { 1962 A struct { 1963 A coverPtrMarshalJSON `json:"a,string"` 1964 } 1965 B struct { 1966 B coverPtrMarshalJSON `json:"b,string"` 1967 } 1968 }{}, 1969 }, 1970 1971 // PtrHeadMarshalJSONMultiFieldsNotRoot 1972 { 1973 name: "PtrHeadMarshalJSONMultiFieldsNotRoot", 1974 data: &struct { 1975 A struct { 1976 A coverMarshalJSON `json:"a"` 1977 } 1978 B struct { 1979 B coverMarshalJSON `json:"b"` 1980 } 1981 }{A: struct { 1982 A coverMarshalJSON `json:"a"` 1983 }{A: coverMarshalJSON{}}, B: struct { 1984 B coverMarshalJSON `json:"b"` 1985 }{B: coverMarshalJSON{}}}, 1986 }, 1987 { 1988 name: "PtrHeadMarshalJSONMultiFieldsNotRootOmitEmpty", 1989 data: &struct { 1990 A struct { 1991 A coverMarshalJSON `json:"a,omitempty"` 1992 } 1993 B struct { 1994 B coverMarshalJSON `json:"b,omitempty"` 1995 } 1996 }{A: struct { 1997 A coverMarshalJSON `json:"a,omitempty"` 1998 }{A: coverMarshalJSON{}}, B: struct { 1999 B coverMarshalJSON `json:"b,omitempty"` 2000 }{B: coverMarshalJSON{}}}, 2001 }, 2002 { 2003 name: "PtrHeadMarshalJSONMultiFieldsNotRootString", 2004 data: &struct { 2005 A struct { 2006 A coverMarshalJSON `json:"a,string"` 2007 } 2008 B struct { 2009 B coverMarshalJSON `json:"b,string"` 2010 } 2011 }{A: struct { 2012 A coverMarshalJSON `json:"a,string"` 2013 }{A: coverMarshalJSON{}}, B: struct { 2014 B coverMarshalJSON `json:"b,string"` 2015 }{B: coverMarshalJSON{}}}, 2016 }, 2017 { 2018 name: "PtrHeadPtrMarshalJSONMultiFieldsNotRoot", 2019 data: &struct { 2020 A struct { 2021 A coverPtrMarshalJSON `json:"a"` 2022 } 2023 B struct { 2024 B coverPtrMarshalJSON `json:"b"` 2025 } 2026 }{A: struct { 2027 A coverPtrMarshalJSON `json:"a"` 2028 }{A: coverPtrMarshalJSON{}}, B: struct { 2029 B coverPtrMarshalJSON `json:"b"` 2030 }{B: coverPtrMarshalJSON{}}}, 2031 }, 2032 { 2033 name: "PtrHeadPtrMarshalJSONMultiFieldsNotRootOmitEmpty", 2034 data: &struct { 2035 A struct { 2036 A coverPtrMarshalJSON `json:"a,omitempty"` 2037 } 2038 B struct { 2039 B coverPtrMarshalJSON `json:"b,omitempty"` 2040 } 2041 }{A: struct { 2042 A coverPtrMarshalJSON `json:"a,omitempty"` 2043 }{A: coverPtrMarshalJSON{}}, B: struct { 2044 B coverPtrMarshalJSON `json:"b,omitempty"` 2045 }{B: coverPtrMarshalJSON{}}}, 2046 }, 2047 { 2048 name: "PtrHeadPtrMarshalJSONMultiFieldsNotRootString", 2049 data: &struct { 2050 A struct { 2051 A coverPtrMarshalJSON `json:"a,string"` 2052 } 2053 B struct { 2054 B coverPtrMarshalJSON `json:"b,string"` 2055 } 2056 }{A: struct { 2057 A coverPtrMarshalJSON `json:"a,string"` 2058 }{A: coverPtrMarshalJSON{}}, B: struct { 2059 B coverPtrMarshalJSON `json:"b,string"` 2060 }{B: coverPtrMarshalJSON{}}}, 2061 }, 2062 2063 // PtrHeadMarshalJSONPtrMultiFieldsNotRoot 2064 { 2065 name: "PtrHeadMarshalJSONPtrMultiFieldsNotRoot", 2066 data: &struct { 2067 A *struct { 2068 A *coverMarshalJSON `json:"a"` 2069 } 2070 B *struct { 2071 B *coverMarshalJSON `json:"b"` 2072 } 2073 }{A: &(struct { 2074 A *coverMarshalJSON `json:"a"` 2075 }{A: &coverMarshalJSON{}}), B: &(struct { 2076 B *coverMarshalJSON `json:"b"` 2077 }{B: &coverMarshalJSON{}})}, 2078 }, 2079 { 2080 name: "PtrHeadMarshalJSONPtrMultiFieldsNotRootOmitEmpty", 2081 data: &struct { 2082 A *struct { 2083 A *coverMarshalJSON `json:"a,omitempty"` 2084 } 2085 B *struct { 2086 B *coverMarshalJSON `json:"b,omitempty"` 2087 } 2088 }{A: &(struct { 2089 A *coverMarshalJSON `json:"a,omitempty"` 2090 }{A: &coverMarshalJSON{}}), B: &(struct { 2091 B *coverMarshalJSON `json:"b,omitempty"` 2092 }{B: &coverMarshalJSON{}})}, 2093 }, 2094 { 2095 name: "PtrHeadMarshalJSONPtrMultiFieldsNotRootString", 2096 data: &struct { 2097 A *struct { 2098 A *coverMarshalJSON `json:"a,string"` 2099 } 2100 B *struct { 2101 B *coverMarshalJSON `json:"b,string"` 2102 } 2103 }{A: &(struct { 2104 A *coverMarshalJSON `json:"a,string"` 2105 }{A: &coverMarshalJSON{}}), B: &(struct { 2106 B *coverMarshalJSON `json:"b,string"` 2107 }{B: &coverMarshalJSON{}})}, 2108 }, 2109 { 2110 name: "PtrHeadPtrMarshalJSONPtrMultiFieldsNotRoot", 2111 data: &struct { 2112 A *struct { 2113 A *coverPtrMarshalJSON `json:"a"` 2114 } 2115 B *struct { 2116 B *coverPtrMarshalJSON `json:"b"` 2117 } 2118 }{A: &(struct { 2119 A *coverPtrMarshalJSON `json:"a"` 2120 }{A: &coverPtrMarshalJSON{}}), B: &(struct { 2121 B *coverPtrMarshalJSON `json:"b"` 2122 }{B: &coverPtrMarshalJSON{}})}, 2123 }, 2124 { 2125 name: "PtrHeadPtrMarshalJSONPtrMultiFieldsNotRootOmitEmpty", 2126 data: &struct { 2127 A *struct { 2128 A *coverPtrMarshalJSON `json:"a,omitempty"` 2129 } 2130 B *struct { 2131 B *coverPtrMarshalJSON `json:"b,omitempty"` 2132 } 2133 }{A: &(struct { 2134 A *coverPtrMarshalJSON `json:"a,omitempty"` 2135 }{A: &coverPtrMarshalJSON{}}), B: &(struct { 2136 B *coverPtrMarshalJSON `json:"b,omitempty"` 2137 }{B: &coverPtrMarshalJSON{}})}, 2138 }, 2139 { 2140 name: "PtrHeadPtrMarshalJSONPtrMultiFieldsNotRootString", 2141 data: &struct { 2142 A *struct { 2143 A *coverPtrMarshalJSON `json:"a,string"` 2144 } 2145 B *struct { 2146 B *coverPtrMarshalJSON `json:"b,string"` 2147 } 2148 }{A: &(struct { 2149 A *coverPtrMarshalJSON `json:"a,string"` 2150 }{A: &coverPtrMarshalJSON{}}), B: &(struct { 2151 B *coverPtrMarshalJSON `json:"b,string"` 2152 }{B: &coverPtrMarshalJSON{}})}, 2153 }, 2154 2155 // PtrHeadMarshalJSONPtrNilMultiFieldsNotRoot 2156 { 2157 name: "PtrHeadMarshalJSONPtrNilMultiFieldsNotRoot", 2158 data: &struct { 2159 A *struct { 2160 A *coverMarshalJSON `json:"a"` 2161 } 2162 B *struct { 2163 B *coverMarshalJSON `json:"b"` 2164 } 2165 }{A: nil, B: nil}, 2166 }, 2167 { 2168 name: "PtrHeadMarshalJSONPtrNilMultiFieldsNotRootOmitEmpty", 2169 data: &struct { 2170 A *struct { 2171 A *coverMarshalJSON `json:"a,omitempty"` 2172 } `json:",omitempty"` 2173 B *struct { 2174 B *coverMarshalJSON `json:"b,omitempty"` 2175 } `json:",omitempty"` 2176 }{A: nil, B: nil}, 2177 }, 2178 { 2179 name: "PtrHeadMarshalJSONPtrNilMultiFieldsNotRootString", 2180 data: &struct { 2181 A *struct { 2182 A *coverMarshalJSON `json:"a,string"` 2183 } `json:",string"` 2184 B *struct { 2185 B *coverMarshalJSON `json:"b,string"` 2186 } `json:",string"` 2187 }{A: nil, B: nil}, 2188 }, 2189 { 2190 name: "PtrHeadPtrMarshalJSONPtrNilMultiFieldsNotRoot", 2191 data: &struct { 2192 A *struct { 2193 A *coverPtrMarshalJSON `json:"a"` 2194 } 2195 B *struct { 2196 B *coverPtrMarshalJSON `json:"b"` 2197 } 2198 }{A: nil, B: nil}, 2199 }, 2200 { 2201 name: "PtrHeadPtrMarshalJSONPtrNilMultiFieldsNotRootOmitEmpty", 2202 data: &struct { 2203 A *struct { 2204 A *coverPtrMarshalJSON `json:"a,omitempty"` 2205 } `json:",omitempty"` 2206 B *struct { 2207 B *coverPtrMarshalJSON `json:"b,omitempty"` 2208 } `json:",omitempty"` 2209 }{A: nil, B: nil}, 2210 }, 2211 { 2212 name: "PtrHeadPtrMarshalJSONPtrNilMultiFieldsNotRootString", 2213 data: &struct { 2214 A *struct { 2215 A *coverPtrMarshalJSON `json:"a,string"` 2216 } `json:",string"` 2217 B *struct { 2218 B *coverPtrMarshalJSON `json:"b,string"` 2219 } `json:",string"` 2220 }{A: nil, B: nil}, 2221 }, 2222 2223 // PtrHeadMarshalJSONNilMultiFieldsNotRoot 2224 { 2225 name: "PtrHeadMarshalJSONNilMultiFieldsNotRoot", 2226 data: (*struct { 2227 A *struct { 2228 A *coverMarshalJSON `json:"a"` 2229 } 2230 B *struct { 2231 B *coverMarshalJSON `json:"b"` 2232 } 2233 })(nil), 2234 }, 2235 { 2236 name: "PtrHeadMarshalJSONNilMultiFieldsNotRootOmitEmpty", 2237 data: (*struct { 2238 A *struct { 2239 A *coverMarshalJSON `json:"a,omitempty"` 2240 } 2241 B *struct { 2242 B *coverMarshalJSON `json:"b,omitempty"` 2243 } 2244 })(nil), 2245 }, 2246 { 2247 name: "PtrHeadMarshalJSONNilMultiFieldsNotRootString", 2248 data: (*struct { 2249 A *struct { 2250 A *coverMarshalJSON `json:"a,string"` 2251 } 2252 B *struct { 2253 B *coverMarshalJSON `json:"b,string"` 2254 } 2255 })(nil), 2256 }, 2257 { 2258 name: "PtrHeadPtrMarshalJSONNilMultiFieldsNotRoot", 2259 data: (*struct { 2260 A *struct { 2261 A *coverPtrMarshalJSON `json:"a"` 2262 } 2263 B *struct { 2264 B *coverPtrMarshalJSON `json:"b"` 2265 } 2266 })(nil), 2267 }, 2268 { 2269 name: "PtrHeadPtrMarshalJSONNilMultiFieldsNotRootOmitEmpty", 2270 data: (*struct { 2271 A *struct { 2272 A *coverPtrMarshalJSON `json:"a,omitempty"` 2273 } 2274 B *struct { 2275 B *coverPtrMarshalJSON `json:"b,omitempty"` 2276 } 2277 })(nil), 2278 }, 2279 { 2280 name: "PtrHeadPtrMarshalJSONNilMultiFieldsNotRootString", 2281 data: (*struct { 2282 A *struct { 2283 A *coverPtrMarshalJSON `json:"a,string"` 2284 } 2285 B *struct { 2286 B *coverPtrMarshalJSON `json:"b,string"` 2287 } 2288 })(nil), 2289 }, 2290 2291 // PtrHeadMarshalJSONDoubleMultiFieldsNotRoot 2292 { 2293 name: "PtrHeadMarshalJSONDoubleMultiFieldsNotRoot", 2294 data: &struct { 2295 A *struct { 2296 A coverMarshalJSON `json:"a"` 2297 B coverMarshalJSON `json:"b"` 2298 } 2299 B *struct { 2300 A coverMarshalJSON `json:"a"` 2301 B coverMarshalJSON `json:"b"` 2302 } 2303 }{A: &(struct { 2304 A coverMarshalJSON `json:"a"` 2305 B coverMarshalJSON `json:"b"` 2306 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}}), B: &(struct { 2307 A coverMarshalJSON `json:"a"` 2308 B coverMarshalJSON `json:"b"` 2309 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}})}, 2310 }, 2311 { 2312 name: "PtrHeadMarshalJSONDoubleMultiFieldsNotRootOmitEmpty", 2313 data: &struct { 2314 A *struct { 2315 A coverMarshalJSON `json:"a,omitempty"` 2316 B coverMarshalJSON `json:"b,omitempty"` 2317 } 2318 B *struct { 2319 A coverMarshalJSON `json:"a,omitempty"` 2320 B coverMarshalJSON `json:"b,omitempty"` 2321 } 2322 }{A: &(struct { 2323 A coverMarshalJSON `json:"a,omitempty"` 2324 B coverMarshalJSON `json:"b,omitempty"` 2325 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}}), B: &(struct { 2326 A coverMarshalJSON `json:"a,omitempty"` 2327 B coverMarshalJSON `json:"b,omitempty"` 2328 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}})}, 2329 }, 2330 { 2331 name: "PtrHeadMarshalJSONDoubleMultiFieldsNotRootString", 2332 data: &struct { 2333 A *struct { 2334 A coverMarshalJSON `json:"a,string"` 2335 B coverMarshalJSON `json:"b,string"` 2336 } 2337 B *struct { 2338 A coverMarshalJSON `json:"a,string"` 2339 B coverMarshalJSON `json:"b,string"` 2340 } 2341 }{A: &(struct { 2342 A coverMarshalJSON `json:"a,string"` 2343 B coverMarshalJSON `json:"b,string"` 2344 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}}), B: &(struct { 2345 A coverMarshalJSON `json:"a,string"` 2346 B coverMarshalJSON `json:"b,string"` 2347 }{A: coverMarshalJSON{}, B: coverMarshalJSON{}})}, 2348 }, 2349 { 2350 name: "PtrHeadPtrMarshalJSONDoubleMultiFieldsNotRoot", 2351 data: &struct { 2352 A *struct { 2353 A coverPtrMarshalJSON `json:"a"` 2354 B coverPtrMarshalJSON `json:"b"` 2355 } 2356 B *struct { 2357 A coverPtrMarshalJSON `json:"a"` 2358 B coverPtrMarshalJSON `json:"b"` 2359 } 2360 }{A: &(struct { 2361 A coverPtrMarshalJSON `json:"a"` 2362 B coverPtrMarshalJSON `json:"b"` 2363 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}}), B: &(struct { 2364 A coverPtrMarshalJSON `json:"a"` 2365 B coverPtrMarshalJSON `json:"b"` 2366 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}})}, 2367 }, 2368 { 2369 name: "PtrHeadPtrMarshalJSONDoubleMultiFieldsNotRootOmitEmpty", 2370 data: &struct { 2371 A *struct { 2372 A coverPtrMarshalJSON `json:"a,omitempty"` 2373 B coverPtrMarshalJSON `json:"b,omitempty"` 2374 } 2375 B *struct { 2376 A coverPtrMarshalJSON `json:"a,omitempty"` 2377 B coverPtrMarshalJSON `json:"b,omitempty"` 2378 } 2379 }{A: &(struct { 2380 A coverPtrMarshalJSON `json:"a,omitempty"` 2381 B coverPtrMarshalJSON `json:"b,omitempty"` 2382 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}}), B: &(struct { 2383 A coverPtrMarshalJSON `json:"a,omitempty"` 2384 B coverPtrMarshalJSON `json:"b,omitempty"` 2385 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}})}, 2386 }, 2387 { 2388 name: "PtrHeadPtrMarshalJSONDoubleMultiFieldsNotRootString", 2389 data: &struct { 2390 A *struct { 2391 A coverPtrMarshalJSON `json:"a,string"` 2392 B coverPtrMarshalJSON `json:"b,string"` 2393 } 2394 B *struct { 2395 A coverPtrMarshalJSON `json:"a,string"` 2396 B coverPtrMarshalJSON `json:"b,string"` 2397 } 2398 }{A: &(struct { 2399 A coverPtrMarshalJSON `json:"a,string"` 2400 B coverPtrMarshalJSON `json:"b,string"` 2401 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}}), B: &(struct { 2402 A coverPtrMarshalJSON `json:"a,string"` 2403 B coverPtrMarshalJSON `json:"b,string"` 2404 }{A: coverPtrMarshalJSON{}, B: coverPtrMarshalJSON{}})}, 2405 }, 2406 2407 // PtrHeadMarshalJSONNilDoubleMultiFieldsNotRoot 2408 { 2409 name: "PtrHeadMarshalJSONNilDoubleMultiFieldsNotRoot", 2410 data: &struct { 2411 A *struct { 2412 A coverMarshalJSON `json:"a"` 2413 B coverMarshalJSON `json:"b"` 2414 } 2415 B *struct { 2416 A coverMarshalJSON `json:"a"` 2417 B coverMarshalJSON `json:"b"` 2418 } 2419 }{A: nil, B: nil}, 2420 }, 2421 { 2422 name: "PtrHeadMarshalJSONNilDoubleMultiFieldsNotRootOmitEmpty", 2423 data: &struct { 2424 A *struct { 2425 A coverMarshalJSON `json:"a,omitempty"` 2426 B coverMarshalJSON `json:"b,omitempty"` 2427 } `json:",omitempty"` 2428 B *struct { 2429 A coverMarshalJSON `json:"a,omitempty"` 2430 B coverMarshalJSON `json:"b,omitempty"` 2431 } `json:",omitempty"` 2432 }{A: nil, B: nil}, 2433 }, 2434 { 2435 name: "PtrHeadMarshalJSONNilDoubleMultiFieldsNotRootString", 2436 data: &struct { 2437 A *struct { 2438 A coverMarshalJSON `json:"a,string"` 2439 B coverMarshalJSON `json:"b,string"` 2440 } 2441 B *struct { 2442 A coverMarshalJSON `json:"a,string"` 2443 B coverMarshalJSON `json:"b,string"` 2444 } 2445 }{A: nil, B: nil}, 2446 }, 2447 { 2448 name: "PtrHeadPtrMarshalJSONNilDoubleMultiFieldsNotRoot", 2449 data: &struct { 2450 A *struct { 2451 A coverPtrMarshalJSON `json:"a"` 2452 B coverPtrMarshalJSON `json:"b"` 2453 } 2454 B *struct { 2455 A coverPtrMarshalJSON `json:"a"` 2456 B coverPtrMarshalJSON `json:"b"` 2457 } 2458 }{A: nil, B: nil}, 2459 }, 2460 { 2461 name: "PtrHeadPtrMarshalJSONNilDoubleMultiFieldsNotRootOmitEmpty", 2462 data: &struct { 2463 A *struct { 2464 A coverPtrMarshalJSON `json:"a,omitempty"` 2465 B coverPtrMarshalJSON `json:"b,omitempty"` 2466 } `json:",omitempty"` 2467 B *struct { 2468 A coverPtrMarshalJSON `json:"a,omitempty"` 2469 B coverPtrMarshalJSON `json:"b,omitempty"` 2470 } `json:",omitempty"` 2471 }{A: nil, B: nil}, 2472 }, 2473 { 2474 name: "PtrHeadPtrMarshalJSONNilDoubleMultiFieldsNotRootString", 2475 data: &struct { 2476 A *struct { 2477 A coverPtrMarshalJSON `json:"a,string"` 2478 B coverPtrMarshalJSON `json:"b,string"` 2479 } 2480 B *struct { 2481 A coverPtrMarshalJSON `json:"a,string"` 2482 B coverPtrMarshalJSON `json:"b,string"` 2483 } 2484 }{A: nil, B: nil}, 2485 }, 2486 2487 // PtrHeadMarshalJSONNilDoubleMultiFieldsNotRoot 2488 { 2489 name: "PtrHeadMarshalJSONNilDoubleMultiFieldsNotRoot", 2490 data: (*struct { 2491 A *struct { 2492 A coverMarshalJSON `json:"a"` 2493 B coverMarshalJSON `json:"b"` 2494 } 2495 B *struct { 2496 A coverMarshalJSON `json:"a"` 2497 B coverMarshalJSON `json:"b"` 2498 } 2499 })(nil), 2500 }, 2501 { 2502 name: "PtrHeadMarshalJSONNilDoubleMultiFieldsNotRootOmitEmpty", 2503 data: (*struct { 2504 A *struct { 2505 A coverMarshalJSON `json:"a,omitempty"` 2506 B coverMarshalJSON `json:"b,omitempty"` 2507 } 2508 B *struct { 2509 A coverMarshalJSON `json:"a,omitempty"` 2510 B coverMarshalJSON `json:"b,omitempty"` 2511 } 2512 })(nil), 2513 }, 2514 { 2515 name: "PtrHeadMarshalJSONNilDoubleMultiFieldsNotRootString", 2516 data: (*struct { 2517 A *struct { 2518 A coverMarshalJSON `json:"a,string"` 2519 B coverMarshalJSON `json:"b,string"` 2520 } 2521 B *struct { 2522 A coverMarshalJSON `json:"a,string"` 2523 B coverMarshalJSON `json:"b,string"` 2524 } 2525 })(nil), 2526 }, 2527 { 2528 name: "PtrHeadPtrMarshalJSONNilDoubleMultiFieldsNotRoot", 2529 data: (*struct { 2530 A *struct { 2531 A coverPtrMarshalJSON `json:"a"` 2532 B coverPtrMarshalJSON `json:"b"` 2533 } 2534 B *struct { 2535 A coverPtrMarshalJSON `json:"a"` 2536 B coverPtrMarshalJSON `json:"b"` 2537 } 2538 })(nil), 2539 }, 2540 { 2541 name: "PtrHeadPtrMarshalJSONNilDoubleMultiFieldsNotRootOmitEmpty", 2542 data: (*struct { 2543 A *struct { 2544 A coverPtrMarshalJSON `json:"a,omitempty"` 2545 B coverPtrMarshalJSON `json:"b,omitempty"` 2546 } 2547 B *struct { 2548 A coverPtrMarshalJSON `json:"a,omitempty"` 2549 B coverPtrMarshalJSON `json:"b,omitempty"` 2550 } 2551 })(nil), 2552 }, 2553 { 2554 name: "PtrHeadPtrMarshalJSONNilDoubleMultiFieldsNotRootString", 2555 data: (*struct { 2556 A *struct { 2557 A coverPtrMarshalJSON `json:"a,string"` 2558 B coverPtrMarshalJSON `json:"b,string"` 2559 } 2560 B *struct { 2561 A coverPtrMarshalJSON `json:"a,string"` 2562 B coverPtrMarshalJSON `json:"b,string"` 2563 } 2564 })(nil), 2565 }, 2566 2567 // PtrHeadMarshalJSONPtrDoubleMultiFieldsNotRoot 2568 { 2569 name: "PtrHeadMarshalJSONPtrDoubleMultiFieldsNotRoot", 2570 data: &struct { 2571 A *struct { 2572 A *coverMarshalJSON `json:"a"` 2573 B *coverMarshalJSON `json:"b"` 2574 } 2575 B *struct { 2576 A *coverMarshalJSON `json:"a"` 2577 B *coverMarshalJSON `json:"b"` 2578 } 2579 }{A: &(struct { 2580 A *coverMarshalJSON `json:"a"` 2581 B *coverMarshalJSON `json:"b"` 2582 }{A: &coverMarshalJSON{}, B: &coverMarshalJSON{}}), B: &(struct { 2583 A *coverMarshalJSON `json:"a"` 2584 B *coverMarshalJSON `json:"b"` 2585 }{A: nil, B: nil})}, 2586 }, 2587 { 2588 name: "PtrHeadMarshalJSONPtrDoubleMultiFieldsNotRootOmitEmpty", 2589 data: &struct { 2590 A *struct { 2591 A *coverMarshalJSON `json:"a,omitempty"` 2592 B *coverMarshalJSON `json:"b,omitempty"` 2593 } 2594 B *struct { 2595 A *coverMarshalJSON `json:"a,omitempty"` 2596 B *coverMarshalJSON `json:"b,omitempty"` 2597 } 2598 }{A: &(struct { 2599 A *coverMarshalJSON `json:"a,omitempty"` 2600 B *coverMarshalJSON `json:"b,omitempty"` 2601 }{A: &coverMarshalJSON{}, B: &coverMarshalJSON{}}), B: &(struct { 2602 A *coverMarshalJSON `json:"a,omitempty"` 2603 B *coverMarshalJSON `json:"b,omitempty"` 2604 }{A: nil, B: nil})}, 2605 }, 2606 { 2607 name: "PtrHeadMarshalJSONPtrDoubleMultiFieldsNotRootString", 2608 data: &struct { 2609 A *struct { 2610 A *coverMarshalJSON `json:"a,string"` 2611 B *coverMarshalJSON `json:"b,string"` 2612 } 2613 B *struct { 2614 A *coverMarshalJSON `json:"a,string"` 2615 B *coverMarshalJSON `json:"b,string"` 2616 } 2617 }{A: &(struct { 2618 A *coverMarshalJSON `json:"a,string"` 2619 B *coverMarshalJSON `json:"b,string"` 2620 }{A: &coverMarshalJSON{}, B: &coverMarshalJSON{}}), B: &(struct { 2621 A *coverMarshalJSON `json:"a,string"` 2622 B *coverMarshalJSON `json:"b,string"` 2623 }{A: nil, B: nil})}, 2624 }, 2625 { 2626 name: "PtrHeadPtrMarshalJSONPtrDoubleMultiFieldsNotRoot", 2627 data: &struct { 2628 A *struct { 2629 A *coverPtrMarshalJSON `json:"a"` 2630 B *coverPtrMarshalJSON `json:"b"` 2631 } 2632 B *struct { 2633 A *coverPtrMarshalJSON `json:"a"` 2634 B *coverPtrMarshalJSON `json:"b"` 2635 } 2636 }{A: &(struct { 2637 A *coverPtrMarshalJSON `json:"a"` 2638 B *coverPtrMarshalJSON `json:"b"` 2639 }{A: &coverPtrMarshalJSON{}, B: &coverPtrMarshalJSON{}}), B: &(struct { 2640 A *coverPtrMarshalJSON `json:"a"` 2641 B *coverPtrMarshalJSON `json:"b"` 2642 }{A: nil, B: nil})}, 2643 }, 2644 { 2645 name: "PtrHeadPtrMarshalJSONPtrDoubleMultiFieldsNotRootOmitEmpty", 2646 data: &struct { 2647 A *struct { 2648 A *coverPtrMarshalJSON `json:"a,omitempty"` 2649 B *coverPtrMarshalJSON `json:"b,omitempty"` 2650 } 2651 B *struct { 2652 A *coverPtrMarshalJSON `json:"a,omitempty"` 2653 B *coverPtrMarshalJSON `json:"b,omitempty"` 2654 } 2655 }{A: &(struct { 2656 A *coverPtrMarshalJSON `json:"a,omitempty"` 2657 B *coverPtrMarshalJSON `json:"b,omitempty"` 2658 }{A: &coverPtrMarshalJSON{}, B: &coverPtrMarshalJSON{}}), B: &(struct { 2659 A *coverPtrMarshalJSON `json:"a,omitempty"` 2660 B *coverPtrMarshalJSON `json:"b,omitempty"` 2661 }{A: nil, B: nil})}, 2662 }, 2663 { 2664 name: "PtrHeadPtrMarshalJSONPtrDoubleMultiFieldsNotRootString", 2665 data: &struct { 2666 A *struct { 2667 A *coverPtrMarshalJSON `json:"a,string"` 2668 B *coverPtrMarshalJSON `json:"b,string"` 2669 } 2670 B *struct { 2671 A *coverPtrMarshalJSON `json:"a,string"` 2672 B *coverPtrMarshalJSON `json:"b,string"` 2673 } 2674 }{A: &(struct { 2675 A *coverPtrMarshalJSON `json:"a,string"` 2676 B *coverPtrMarshalJSON `json:"b,string"` 2677 }{A: &coverPtrMarshalJSON{}, B: &coverPtrMarshalJSON{}}), B: &(struct { 2678 A *coverPtrMarshalJSON `json:"a,string"` 2679 B *coverPtrMarshalJSON `json:"b,string"` 2680 }{A: nil, B: nil})}, 2681 }, 2682 2683 // PtrHeadMarshalJSONPtrNilDoubleMultiFieldsNotRoot 2684 { 2685 name: "PtrHeadMarshalJSONPtrNilDoubleMultiFieldsNotRoot", 2686 data: &struct { 2687 A *struct { 2688 A *coverMarshalJSON `json:"a"` 2689 B *coverMarshalJSON `json:"b"` 2690 } 2691 B *struct { 2692 A *coverMarshalJSON `json:"a"` 2693 B *coverMarshalJSON `json:"b"` 2694 } 2695 }{A: nil, B: nil}, 2696 }, 2697 { 2698 name: "PtrHeadMarshalJSONPtrNilDoubleMultiFieldsNotRootOmitEmpty", 2699 data: &struct { 2700 A *struct { 2701 A *coverMarshalJSON `json:"a,omitempty"` 2702 B *coverMarshalJSON `json:"b,omitempty"` 2703 } `json:",omitempty"` 2704 B *struct { 2705 A *coverMarshalJSON `json:"a,omitempty"` 2706 B *coverMarshalJSON `json:"b,omitempty"` 2707 } `json:",omitempty"` 2708 }{A: nil, B: nil}, 2709 }, 2710 { 2711 name: "PtrHeadMarshalJSONPtrNilDoubleMultiFieldsNotRootString", 2712 data: &struct { 2713 A *struct { 2714 A *coverMarshalJSON `json:"a,string"` 2715 B *coverMarshalJSON `json:"b,string"` 2716 } 2717 B *struct { 2718 A *coverMarshalJSON `json:"a,string"` 2719 B *coverMarshalJSON `json:"b,string"` 2720 } 2721 }{A: nil, B: nil}, 2722 }, 2723 { 2724 name: "PtrHeadPtrMarshalJSONPtrNilDoubleMultiFieldsNotRoot", 2725 data: &struct { 2726 A *struct { 2727 A *coverPtrMarshalJSON `json:"a"` 2728 B *coverPtrMarshalJSON `json:"b"` 2729 } 2730 B *struct { 2731 A *coverPtrMarshalJSON `json:"a"` 2732 B *coverPtrMarshalJSON `json:"b"` 2733 } 2734 }{A: nil, B: nil}, 2735 }, 2736 { 2737 name: "PtrHeadPtrMarshalJSONPtrNilDoubleMultiFieldsNotRootOmitEmpty", 2738 data: &struct { 2739 A *struct { 2740 A *coverPtrMarshalJSON `json:"a,omitempty"` 2741 B *coverPtrMarshalJSON `json:"b,omitempty"` 2742 } `json:",omitempty"` 2743 B *struct { 2744 A *coverPtrMarshalJSON `json:"a,omitempty"` 2745 B *coverPtrMarshalJSON `json:"b,omitempty"` 2746 } `json:",omitempty"` 2747 }{A: nil, B: nil}, 2748 }, 2749 { 2750 name: "PtrHeadPtrMarshalJSONPtrNilDoubleMultiFieldsNotRootString", 2751 data: &struct { 2752 A *struct { 2753 A *coverPtrMarshalJSON `json:"a,string"` 2754 B *coverPtrMarshalJSON `json:"b,string"` 2755 } 2756 B *struct { 2757 A *coverPtrMarshalJSON `json:"a,string"` 2758 B *coverPtrMarshalJSON `json:"b,string"` 2759 } 2760 }{A: nil, B: nil}, 2761 }, 2762 2763 // PtrHeadMarshalJSONPtrNilDoubleMultiFieldsNotRoot 2764 { 2765 name: "PtrHeadMarshalJSONPtrNilDoubleMultiFieldsNotRoot", 2766 data: (*struct { 2767 A *struct { 2768 A *coverMarshalJSON `json:"a"` 2769 B *coverMarshalJSON `json:"b"` 2770 } 2771 B *struct { 2772 A *coverMarshalJSON `json:"a"` 2773 B *coverMarshalJSON `json:"b"` 2774 } 2775 })(nil), 2776 }, 2777 { 2778 name: "PtrHeadMarshalJSONPtrNilDoubleMultiFieldsNotRootOmitEmpty", 2779 data: (*struct { 2780 A *struct { 2781 A *coverMarshalJSON `json:"a,omitempty"` 2782 B *coverMarshalJSON `json:"b,omitempty"` 2783 } 2784 B *struct { 2785 A *coverMarshalJSON `json:"a,omitempty"` 2786 B *coverMarshalJSON `json:"b,omitempty"` 2787 } 2788 })(nil), 2789 }, 2790 { 2791 name: "PtrHeadMarshalJSONPtrNilDoubleMultiFieldsNotRootString", 2792 data: (*struct { 2793 A *struct { 2794 A *coverMarshalJSON `json:"a,string"` 2795 B *coverMarshalJSON `json:"b,string"` 2796 } 2797 B *struct { 2798 A *coverMarshalJSON `json:"a,string"` 2799 B *coverMarshalJSON `json:"b,string"` 2800 } 2801 })(nil), 2802 }, 2803 { 2804 name: "PtrHeadPtrMarshalJSONPtrNilDoubleMultiFieldsNotRoot", 2805 data: (*struct { 2806 A *struct { 2807 A *coverPtrMarshalJSON `json:"a"` 2808 B *coverPtrMarshalJSON `json:"b"` 2809 } 2810 B *struct { 2811 A *coverPtrMarshalJSON `json:"a"` 2812 B *coverPtrMarshalJSON `json:"b"` 2813 } 2814 })(nil), 2815 }, 2816 { 2817 name: "PtrHeadPtrMarshalJSONPtrNilDoubleMultiFieldsNotRootOmitEmpty", 2818 data: (*struct { 2819 A *struct { 2820 A *coverPtrMarshalJSON `json:"a,omitempty"` 2821 B *coverPtrMarshalJSON `json:"b,omitempty"` 2822 } 2823 B *struct { 2824 A *coverPtrMarshalJSON `json:"a,omitempty"` 2825 B *coverPtrMarshalJSON `json:"b,omitempty"` 2826 } 2827 })(nil), 2828 }, 2829 { 2830 name: "PtrHeadPtrMarshalJSONPtrNilDoubleMultiFieldsNotRootString", 2831 data: (*struct { 2832 A *struct { 2833 A *coverPtrMarshalJSON `json:"a,string"` 2834 B *coverPtrMarshalJSON `json:"b,string"` 2835 } 2836 B *struct { 2837 A *coverPtrMarshalJSON `json:"a,string"` 2838 B *coverPtrMarshalJSON `json:"b,string"` 2839 } 2840 })(nil), 2841 }, 2842 2843 // AnonymousHeadMarshalJSON 2844 { 2845 name: "AnonymousHeadMarshalJSON", 2846 data: struct { 2847 structMarshalJSON 2848 B coverMarshalJSON `json:"b"` 2849 }{ 2850 structMarshalJSON: structMarshalJSON{A: coverMarshalJSON{}}, 2851 B: coverMarshalJSON{}, 2852 }, 2853 }, 2854 { 2855 name: "AnonymousHeadMarshalJSONOmitEmpty", 2856 data: struct { 2857 structMarshalJSONOmitEmpty 2858 B coverMarshalJSON `json:"b,omitempty"` 2859 }{ 2860 structMarshalJSONOmitEmpty: structMarshalJSONOmitEmpty{A: coverMarshalJSON{}}, 2861 B: coverMarshalJSON{}, 2862 }, 2863 }, 2864 { 2865 name: "AnonymousHeadMarshalJSONString", 2866 data: struct { 2867 structMarshalJSONString 2868 B coverMarshalJSON `json:"b,string"` 2869 }{ 2870 structMarshalJSONString: structMarshalJSONString{A: coverMarshalJSON{}}, 2871 B: coverMarshalJSON{}, 2872 }, 2873 }, 2874 { 2875 name: "AnonymousHeadPtrMarshalJSON", 2876 data: struct { 2877 structPtrMarshalJSON 2878 B coverPtrMarshalJSON `json:"b"` 2879 }{ 2880 structPtrMarshalJSON: structPtrMarshalJSON{A: coverPtrMarshalJSON{}}, 2881 B: coverPtrMarshalJSON{}, 2882 }, 2883 }, 2884 { 2885 name: "AnonymousHeadPtrMarshalJSONOmitEmpty", 2886 data: struct { 2887 structPtrMarshalJSONOmitEmpty 2888 B coverPtrMarshalJSON `json:"b,omitempty"` 2889 }{ 2890 structPtrMarshalJSONOmitEmpty: structPtrMarshalJSONOmitEmpty{A: coverPtrMarshalJSON{}}, 2891 B: coverPtrMarshalJSON{}, 2892 }, 2893 }, 2894 { 2895 name: "AnonymousHeadPtrMarshalJSONString", 2896 data: struct { 2897 structPtrMarshalJSONString 2898 B coverPtrMarshalJSON `json:"b,string"` 2899 }{ 2900 structPtrMarshalJSONString: structPtrMarshalJSONString{A: coverPtrMarshalJSON{}}, 2901 B: coverPtrMarshalJSON{}, 2902 }, 2903 }, 2904 2905 // PtrAnonymousHeadMarshalJSON 2906 { 2907 name: "PtrAnonymousHeadMarshalJSON", 2908 data: struct { 2909 *structMarshalJSON 2910 B coverMarshalJSON `json:"b"` 2911 }{ 2912 structMarshalJSON: &structMarshalJSON{A: coverMarshalJSON{}}, 2913 B: coverMarshalJSON{}, 2914 }, 2915 }, 2916 { 2917 name: "PtrAnonymousHeadMarshalJSONOmitEmpty", 2918 data: struct { 2919 *structMarshalJSONOmitEmpty 2920 B coverMarshalJSON `json:"b,omitempty"` 2921 }{ 2922 structMarshalJSONOmitEmpty: &structMarshalJSONOmitEmpty{A: coverMarshalJSON{}}, 2923 B: coverMarshalJSON{}, 2924 }, 2925 }, 2926 { 2927 name: "PtrAnonymousHeadMarshalJSONString", 2928 data: struct { 2929 *structMarshalJSONString 2930 B coverMarshalJSON `json:"b,string"` 2931 }{ 2932 structMarshalJSONString: &structMarshalJSONString{A: coverMarshalJSON{}}, 2933 B: coverMarshalJSON{}, 2934 }, 2935 }, 2936 { 2937 name: "PtrAnonymousHeadPtrMarshalJSON", 2938 data: struct { 2939 *structPtrMarshalJSON 2940 B coverPtrMarshalJSON `json:"b"` 2941 }{ 2942 structPtrMarshalJSON: &structPtrMarshalJSON{A: coverPtrMarshalJSON{}}, 2943 B: coverPtrMarshalJSON{}, 2944 }, 2945 }, 2946 { 2947 name: "PtrAnonymousHeadPtrMarshalJSONOmitEmpty", 2948 data: struct { 2949 *structPtrMarshalJSONOmitEmpty 2950 B coverPtrMarshalJSON `json:"b,omitempty"` 2951 }{ 2952 structPtrMarshalJSONOmitEmpty: &structPtrMarshalJSONOmitEmpty{A: coverPtrMarshalJSON{}}, 2953 B: coverPtrMarshalJSON{}, 2954 }, 2955 }, 2956 { 2957 name: "PtrAnonymousHeadPtrMarshalJSONString", 2958 data: struct { 2959 *structPtrMarshalJSONString 2960 B coverPtrMarshalJSON `json:"b,string"` 2961 }{ 2962 structPtrMarshalJSONString: &structPtrMarshalJSONString{A: coverPtrMarshalJSON{}}, 2963 B: coverPtrMarshalJSON{}, 2964 }, 2965 }, 2966 2967 // PtrAnonymousHeadMarshalJSONNil 2968 { 2969 name: "PtrAnonymousHeadMarshalJSONNil", 2970 data: struct { 2971 *structMarshalJSON 2972 B coverMarshalJSON `json:"b"` 2973 }{ 2974 structMarshalJSON: &structMarshalJSON{A: coverMarshalJSON{}}, 2975 B: coverMarshalJSON{}, 2976 }, 2977 }, 2978 { 2979 name: "PtrAnonymousHeadMarshalJSONNilOmitEmpty", 2980 data: struct { 2981 *structMarshalJSONOmitEmpty 2982 B coverMarshalJSON `json:"b,omitempty"` 2983 }{ 2984 structMarshalJSONOmitEmpty: &structMarshalJSONOmitEmpty{A: coverMarshalJSON{}}, 2985 B: coverMarshalJSON{}, 2986 }, 2987 }, 2988 { 2989 name: "PtrAnonymousHeadMarshalJSONNilString", 2990 data: struct { 2991 *structMarshalJSONString 2992 B coverMarshalJSON `json:"b,string"` 2993 }{ 2994 structMarshalJSONString: &structMarshalJSONString{A: coverMarshalJSON{}}, 2995 B: coverMarshalJSON{}, 2996 }, 2997 }, 2998 { 2999 name: "PtrAnonymousHeadPtrMarshalJSONNil", 3000 data: struct { 3001 *structPtrMarshalJSON 3002 B coverPtrMarshalJSON `json:"b"` 3003 }{ 3004 structPtrMarshalJSON: &structPtrMarshalJSON{A: coverPtrMarshalJSON{}}, 3005 B: coverPtrMarshalJSON{}, 3006 }, 3007 }, 3008 { 3009 name: "PtrAnonymousHeadPtrMarshalJSONNilOmitEmpty", 3010 data: struct { 3011 *structPtrMarshalJSONOmitEmpty 3012 B coverPtrMarshalJSON `json:"b,omitempty"` 3013 }{ 3014 structPtrMarshalJSONOmitEmpty: &structPtrMarshalJSONOmitEmpty{A: coverPtrMarshalJSON{}}, 3015 B: coverPtrMarshalJSON{}, 3016 }, 3017 }, 3018 { 3019 name: "PtrAnonymousHeadPtrMarshalJSONNilString", 3020 data: struct { 3021 *structPtrMarshalJSONString 3022 B coverPtrMarshalJSON `json:"b,string"` 3023 }{ 3024 structPtrMarshalJSONString: &structPtrMarshalJSONString{A: coverPtrMarshalJSON{}}, 3025 B: coverPtrMarshalJSON{}, 3026 }, 3027 }, 3028 3029 // NilPtrAnonymousHeadMarshalJSON 3030 { 3031 name: "NilPtrAnonymousHeadMarshalJSON", 3032 data: struct { 3033 *structMarshalJSON 3034 B coverMarshalJSON `json:"b"` 3035 }{ 3036 structMarshalJSON: nil, 3037 B: coverMarshalJSON{}, 3038 }, 3039 }, 3040 { 3041 name: "NilPtrAnonymousHeadMarshalJSONOmitEmpty", 3042 data: struct { 3043 *structMarshalJSONOmitEmpty 3044 B coverMarshalJSON `json:"b,omitempty"` 3045 }{ 3046 structMarshalJSONOmitEmpty: nil, 3047 B: coverMarshalJSON{}, 3048 }, 3049 }, 3050 { 3051 name: "NilPtrAnonymousHeadMarshalJSONString", 3052 data: struct { 3053 *structMarshalJSONString 3054 B coverMarshalJSON `json:"b,string"` 3055 }{ 3056 structMarshalJSONString: nil, 3057 B: coverMarshalJSON{}, 3058 }, 3059 }, 3060 { 3061 name: "NilPtrAnonymousHeadPtrMarshalJSON", 3062 data: struct { 3063 *structPtrMarshalJSON 3064 B coverPtrMarshalJSON `json:"b"` 3065 }{ 3066 structPtrMarshalJSON: nil, 3067 B: coverPtrMarshalJSON{}, 3068 }, 3069 }, 3070 { 3071 name: "NilPtrAnonymousHeadPtrMarshalJSONOmitEmpty", 3072 data: struct { 3073 *structPtrMarshalJSONOmitEmpty 3074 B coverPtrMarshalJSON `json:"b,omitempty"` 3075 }{ 3076 structPtrMarshalJSONOmitEmpty: nil, 3077 B: coverPtrMarshalJSON{}, 3078 }, 3079 }, 3080 { 3081 name: "NilPtrAnonymousHeadPtrMarshalJSONString", 3082 data: struct { 3083 *structPtrMarshalJSONString 3084 B coverPtrMarshalJSON `json:"b,string"` 3085 }{ 3086 structPtrMarshalJSONString: nil, 3087 B: coverPtrMarshalJSON{}, 3088 }, 3089 }, 3090 3091 // AnonymousHeadMarshalJSONPtr 3092 { 3093 name: "AnonymousHeadMarshalJSONPtr", 3094 data: struct { 3095 structMarshalJSONPtr 3096 B *coverMarshalJSON `json:"b"` 3097 }{ 3098 structMarshalJSONPtr: structMarshalJSONPtr{A: &coverMarshalJSON{}}, 3099 B: nil, 3100 }, 3101 }, 3102 { 3103 name: "AnonymousHeadMarshalJSONPtrOmitEmpty", 3104 data: struct { 3105 structMarshalJSONPtrOmitEmpty 3106 B *coverMarshalJSON `json:"b,omitempty"` 3107 }{ 3108 structMarshalJSONPtrOmitEmpty: structMarshalJSONPtrOmitEmpty{A: &coverMarshalJSON{}}, 3109 B: nil, 3110 }, 3111 }, 3112 { 3113 name: "AnonymousHeadMarshalJSONPtrString", 3114 data: struct { 3115 structMarshalJSONPtrString 3116 B *coverMarshalJSON `json:"b,string"` 3117 }{ 3118 structMarshalJSONPtrString: structMarshalJSONPtrString{A: &coverMarshalJSON{}}, 3119 B: nil, 3120 }, 3121 }, 3122 { 3123 name: "AnonymousHeadPtrMarshalJSONPtr", 3124 data: struct { 3125 structPtrMarshalJSONPtr 3126 B *coverPtrMarshalJSON `json:"b"` 3127 }{ 3128 structPtrMarshalJSONPtr: structPtrMarshalJSONPtr{A: &coverPtrMarshalJSON{}}, 3129 B: nil, 3130 }, 3131 }, 3132 { 3133 name: "AnonymousHeadPtrMarshalJSONPtrOmitEmpty", 3134 data: struct { 3135 structPtrMarshalJSONPtrOmitEmpty 3136 B *coverPtrMarshalJSON `json:"b,omitempty"` 3137 }{ 3138 structPtrMarshalJSONPtrOmitEmpty: structPtrMarshalJSONPtrOmitEmpty{A: &coverPtrMarshalJSON{}}, 3139 B: nil, 3140 }, 3141 }, 3142 { 3143 name: "AnonymousHeadPtrMarshalJSONPtrString", 3144 data: struct { 3145 structPtrMarshalJSONPtrString 3146 B *coverPtrMarshalJSON `json:"b,string"` 3147 }{ 3148 structPtrMarshalJSONPtrString: structPtrMarshalJSONPtrString{A: &coverPtrMarshalJSON{}}, 3149 B: nil, 3150 }, 3151 }, 3152 3153 // AnonymousHeadMarshalJSONPtrNil 3154 { 3155 name: "AnonymousHeadMarshalJSONPtrNil", 3156 data: struct { 3157 structMarshalJSONPtr 3158 B *coverMarshalJSON `json:"b"` 3159 }{ 3160 structMarshalJSONPtr: structMarshalJSONPtr{A: nil}, 3161 B: &coverMarshalJSON{}, 3162 }, 3163 }, 3164 { 3165 name: "AnonymousHeadMarshalJSONPtrNilOmitEmpty", 3166 data: struct { 3167 structMarshalJSONPtrOmitEmpty 3168 B *coverMarshalJSON `json:"b,omitempty"` 3169 }{ 3170 structMarshalJSONPtrOmitEmpty: structMarshalJSONPtrOmitEmpty{A: nil}, 3171 B: &coverMarshalJSON{}, 3172 }, 3173 }, 3174 { 3175 name: "AnonymousHeadMarshalJSONPtrNilString", 3176 data: struct { 3177 structMarshalJSONPtrString 3178 B *coverMarshalJSON `json:"b,string"` 3179 }{ 3180 structMarshalJSONPtrString: structMarshalJSONPtrString{A: nil}, 3181 B: &coverMarshalJSON{}, 3182 }, 3183 }, 3184 { 3185 name: "AnonymousHeadPtrMarshalJSONPtrNil", 3186 data: struct { 3187 structPtrMarshalJSONPtr 3188 B *coverPtrMarshalJSON `json:"b"` 3189 }{ 3190 structPtrMarshalJSONPtr: structPtrMarshalJSONPtr{A: nil}, 3191 B: &coverPtrMarshalJSON{}, 3192 }, 3193 }, 3194 { 3195 name: "AnonymousHeadPtrMarshalJSONPtrNilOmitEmpty", 3196 data: struct { 3197 structPtrMarshalJSONPtrOmitEmpty 3198 B *coverPtrMarshalJSON `json:"b,omitempty"` 3199 }{ 3200 structPtrMarshalJSONPtrOmitEmpty: structPtrMarshalJSONPtrOmitEmpty{A: nil}, 3201 B: &coverPtrMarshalJSON{}, 3202 }, 3203 }, 3204 { 3205 name: "AnonymousHeadPtrMarshalJSONPtrNilString", 3206 data: struct { 3207 structPtrMarshalJSONPtrString 3208 B *coverPtrMarshalJSON `json:"b,string"` 3209 }{ 3210 structPtrMarshalJSONPtrString: structPtrMarshalJSONPtrString{A: nil}, 3211 B: &coverPtrMarshalJSON{}, 3212 }, 3213 }, 3214 3215 // PtrAnonymousHeadMarshalJSONPtr 3216 { 3217 name: "PtrAnonymousHeadMarshalJSONPtr", 3218 data: struct { 3219 *structMarshalJSONPtr 3220 B *coverMarshalJSON `json:"b"` 3221 }{ 3222 structMarshalJSONPtr: &structMarshalJSONPtr{A: &coverMarshalJSON{}}, 3223 B: nil, 3224 }, 3225 }, 3226 { 3227 name: "PtrAnonymousHeadMarshalJSONPtrOmitEmpty", 3228 data: struct { 3229 *structMarshalJSONPtrOmitEmpty 3230 B *coverMarshalJSON `json:"b,omitempty"` 3231 }{ 3232 structMarshalJSONPtrOmitEmpty: &structMarshalJSONPtrOmitEmpty{A: &coverMarshalJSON{}}, 3233 B: nil, 3234 }, 3235 }, 3236 { 3237 name: "PtrAnonymousHeadMarshalJSONPtrString", 3238 data: struct { 3239 *structMarshalJSONPtrString 3240 B *coverMarshalJSON `json:"b,string"` 3241 }{ 3242 structMarshalJSONPtrString: &structMarshalJSONPtrString{A: &coverMarshalJSON{}}, 3243 B: nil, 3244 }, 3245 }, 3246 { 3247 name: "PtrAnonymousHeadPtrMarshalJSONPtr", 3248 data: struct { 3249 *structPtrMarshalJSONPtr 3250 B *coverPtrMarshalJSON `json:"b"` 3251 }{ 3252 structPtrMarshalJSONPtr: &structPtrMarshalJSONPtr{A: &coverPtrMarshalJSON{}}, 3253 B: nil, 3254 }, 3255 }, 3256 { 3257 name: "PtrAnonymousHeadPtrMarshalJSONPtrOmitEmpty", 3258 data: struct { 3259 *structPtrMarshalJSONPtrOmitEmpty 3260 B *coverPtrMarshalJSON `json:"b,omitempty"` 3261 }{ 3262 structPtrMarshalJSONPtrOmitEmpty: &structPtrMarshalJSONPtrOmitEmpty{A: &coverPtrMarshalJSON{}}, 3263 B: nil, 3264 }, 3265 }, 3266 { 3267 name: "PtrAnonymousHeadPtrMarshalJSONPtrString", 3268 data: struct { 3269 *structPtrMarshalJSONPtrString 3270 B *coverPtrMarshalJSON `json:"b,string"` 3271 }{ 3272 structPtrMarshalJSONPtrString: &structPtrMarshalJSONPtrString{A: &coverPtrMarshalJSON{}}, 3273 B: nil, 3274 }, 3275 }, 3276 3277 // NilPtrAnonymousHeadMarshalJSONPtr 3278 { 3279 name: "NilPtrAnonymousHeadMarshalJSONPtr", 3280 data: struct { 3281 *structMarshalJSONPtr 3282 B *coverMarshalJSON `json:"b"` 3283 }{ 3284 structMarshalJSONPtr: nil, 3285 B: &coverMarshalJSON{}, 3286 }, 3287 }, 3288 { 3289 name: "NilPtrAnonymousHeadMarshalJSONPtrOmitEmpty", 3290 data: struct { 3291 *structMarshalJSONPtrOmitEmpty 3292 B *coverMarshalJSON `json:"b,omitempty"` 3293 }{ 3294 structMarshalJSONPtrOmitEmpty: nil, 3295 B: &coverMarshalJSON{}, 3296 }, 3297 }, 3298 { 3299 name: "NilPtrAnonymousHeadMarshalJSONPtrString", 3300 data: struct { 3301 *structMarshalJSONPtrString 3302 B *coverMarshalJSON `json:"b,string"` 3303 }{ 3304 structMarshalJSONPtrString: nil, 3305 B: &coverMarshalJSON{}, 3306 }, 3307 }, 3308 { 3309 name: "NilPtrAnonymousHeadPtrMarshalJSONPtr", 3310 data: struct { 3311 *structPtrMarshalJSONPtr 3312 B *coverPtrMarshalJSON `json:"b"` 3313 }{ 3314 structPtrMarshalJSONPtr: nil, 3315 B: &coverPtrMarshalJSON{}, 3316 }, 3317 }, 3318 { 3319 name: "NilPtrAnonymousHeadPtrMarshalJSONPtrOmitEmpty", 3320 data: struct { 3321 *structPtrMarshalJSONPtrOmitEmpty 3322 B *coverPtrMarshalJSON `json:"b,omitempty"` 3323 }{ 3324 structPtrMarshalJSONPtrOmitEmpty: nil, 3325 B: &coverPtrMarshalJSON{}, 3326 }, 3327 }, 3328 { 3329 name: "NilPtrAnonymousHeadPtrMarshalJSONPtrString", 3330 data: struct { 3331 *structPtrMarshalJSONPtrString 3332 B *coverPtrMarshalJSON `json:"b,string"` 3333 }{ 3334 structPtrMarshalJSONPtrString: nil, 3335 B: &coverPtrMarshalJSON{}, 3336 }, 3337 }, 3338 3339 // AnonymousHeadMarshalJSONOnly 3340 { 3341 name: "AnonymousHeadMarshalJSONOnly", 3342 data: struct { 3343 structMarshalJSON 3344 }{ 3345 structMarshalJSON: structMarshalJSON{A: coverMarshalJSON{}}, 3346 }, 3347 }, 3348 { 3349 name: "AnonymousHeadMarshalJSONOnlyOmitEmpty", 3350 data: struct { 3351 structMarshalJSONOmitEmpty 3352 }{ 3353 structMarshalJSONOmitEmpty: structMarshalJSONOmitEmpty{A: coverMarshalJSON{}}, 3354 }, 3355 }, 3356 { 3357 name: "AnonymousHeadMarshalJSONOnlyString", 3358 data: struct { 3359 structMarshalJSONString 3360 }{ 3361 structMarshalJSONString: structMarshalJSONString{A: coverMarshalJSON{}}, 3362 }, 3363 }, 3364 { 3365 name: "AnonymousHeadPtrMarshalJSONOnly", 3366 data: struct { 3367 structPtrMarshalJSON 3368 }{ 3369 structPtrMarshalJSON: structPtrMarshalJSON{A: coverPtrMarshalJSON{}}, 3370 }, 3371 }, 3372 { 3373 name: "AnonymousHeadPtrMarshalJSONOnlyOmitEmpty", 3374 data: struct { 3375 structPtrMarshalJSONOmitEmpty 3376 }{ 3377 structPtrMarshalJSONOmitEmpty: structPtrMarshalJSONOmitEmpty{A: coverPtrMarshalJSON{}}, 3378 }, 3379 }, 3380 { 3381 name: "AnonymousHeadPtrMarshalJSONOnlyString", 3382 data: struct { 3383 structPtrMarshalJSONString 3384 }{ 3385 structPtrMarshalJSONString: structPtrMarshalJSONString{A: coverPtrMarshalJSON{}}, 3386 }, 3387 }, 3388 3389 // PtrAnonymousHeadMarshalJSONOnly 3390 { 3391 name: "PtrAnonymousHeadMarshalJSONOnly", 3392 data: struct { 3393 *structMarshalJSON 3394 }{ 3395 structMarshalJSON: &structMarshalJSON{A: coverMarshalJSON{}}, 3396 }, 3397 }, 3398 { 3399 name: "PtrAnonymousHeadMarshalJSONOnlyOmitEmpty", 3400 data: struct { 3401 *structMarshalJSONOmitEmpty 3402 }{ 3403 structMarshalJSONOmitEmpty: &structMarshalJSONOmitEmpty{A: coverMarshalJSON{}}, 3404 }, 3405 }, 3406 { 3407 name: "PtrAnonymousHeadMarshalJSONOnlyString", 3408 data: struct { 3409 *structMarshalJSONString 3410 }{ 3411 structMarshalJSONString: &structMarshalJSONString{A: coverMarshalJSON{}}, 3412 }, 3413 }, 3414 { 3415 name: "PtrAnonymousHeadPtrMarshalJSONOnly", 3416 data: struct { 3417 *structPtrMarshalJSON 3418 }{ 3419 structPtrMarshalJSON: &structPtrMarshalJSON{A: coverPtrMarshalJSON{}}, 3420 }, 3421 }, 3422 { 3423 name: "PtrAnonymousHeadPtrMarshalJSONOnlyOmitEmpty", 3424 data: struct { 3425 *structPtrMarshalJSONOmitEmpty 3426 }{ 3427 structPtrMarshalJSONOmitEmpty: &structPtrMarshalJSONOmitEmpty{A: coverPtrMarshalJSON{}}, 3428 }, 3429 }, 3430 { 3431 name: "PtrAnonymousHeadPtrMarshalJSONOnlyString", 3432 data: struct { 3433 *structPtrMarshalJSONString 3434 }{ 3435 structPtrMarshalJSONString: &structPtrMarshalJSONString{A: coverPtrMarshalJSON{}}, 3436 }, 3437 }, 3438 3439 // NilPtrAnonymousHeadMarshalJSONOnly 3440 { 3441 name: "NilPtrAnonymousHeadMarshalJSONOnly", 3442 data: struct { 3443 *structMarshalJSON 3444 }{ 3445 structMarshalJSON: nil, 3446 }, 3447 }, 3448 { 3449 name: "NilPtrAnonymousHeadMarshalJSONOnlyOmitEmpty", 3450 data: struct { 3451 *structMarshalJSONOmitEmpty 3452 }{ 3453 structMarshalJSONOmitEmpty: nil, 3454 }, 3455 }, 3456 { 3457 name: "NilPtrAnonymousHeadMarshalJSONOnlyString", 3458 data: struct { 3459 *structMarshalJSONString 3460 }{ 3461 structMarshalJSONString: nil, 3462 }, 3463 }, 3464 { 3465 name: "NilPtrAnonymousHeadPtrMarshalJSONOnly", 3466 data: struct { 3467 *structPtrMarshalJSON 3468 }{ 3469 structPtrMarshalJSON: nil, 3470 }, 3471 }, 3472 { 3473 name: "NilPtrAnonymousHeadPtrMarshalJSONOnlyOmitEmpty", 3474 data: struct { 3475 *structPtrMarshalJSONOmitEmpty 3476 }{ 3477 structPtrMarshalJSONOmitEmpty: nil, 3478 }, 3479 }, 3480 { 3481 name: "NilPtrAnonymousHeadPtrMarshalJSONOnlyString", 3482 data: struct { 3483 *structPtrMarshalJSONString 3484 }{ 3485 structPtrMarshalJSONString: nil, 3486 }, 3487 }, 3488 3489 // AnonymousHeadMarshalJSONPtrOnly 3490 { 3491 name: "AnonymousHeadMarshalJSONPtrOnly", 3492 data: struct { 3493 structMarshalJSONPtr 3494 }{ 3495 structMarshalJSONPtr: structMarshalJSONPtr{A: &coverMarshalJSON{}}, 3496 }, 3497 }, 3498 { 3499 name: "AnonymousHeadMarshalJSONPtrOnlyOmitEmpty", 3500 data: struct { 3501 structMarshalJSONPtrOmitEmpty 3502 }{ 3503 structMarshalJSONPtrOmitEmpty: structMarshalJSONPtrOmitEmpty{A: &coverMarshalJSON{}}, 3504 }, 3505 }, 3506 { 3507 name: "AnonymousHeadMarshalJSONPtrOnlyString", 3508 data: struct { 3509 structMarshalJSONPtrString 3510 }{ 3511 structMarshalJSONPtrString: structMarshalJSONPtrString{A: &coverMarshalJSON{}}, 3512 }, 3513 }, 3514 { 3515 name: "AnonymousHeadPtrMarshalJSONPtrOnly", 3516 data: struct { 3517 structPtrMarshalJSONPtr 3518 }{ 3519 structPtrMarshalJSONPtr: structPtrMarshalJSONPtr{A: &coverPtrMarshalJSON{}}, 3520 }, 3521 }, 3522 { 3523 name: "AnonymousHeadPtrMarshalJSONPtrOnlyOmitEmpty", 3524 data: struct { 3525 structPtrMarshalJSONPtrOmitEmpty 3526 }{ 3527 structPtrMarshalJSONPtrOmitEmpty: structPtrMarshalJSONPtrOmitEmpty{A: &coverPtrMarshalJSON{}}, 3528 }, 3529 }, 3530 { 3531 name: "AnonymousHeadPtrMarshalJSONPtrOnlyString", 3532 data: struct { 3533 structPtrMarshalJSONPtrString 3534 }{ 3535 structPtrMarshalJSONPtrString: structPtrMarshalJSONPtrString{A: &coverPtrMarshalJSON{}}, 3536 }, 3537 }, 3538 3539 // AnonymousHeadMarshalJSONPtrNilOnly 3540 { 3541 name: "AnonymousHeadMarshalJSONPtrNilOnly", 3542 data: struct { 3543 structMarshalJSONPtr 3544 }{ 3545 structMarshalJSONPtr: structMarshalJSONPtr{A: nil}, 3546 }, 3547 }, 3548 { 3549 name: "AnonymousHeadMarshalJSONPtrNilOnlyOmitEmpty", 3550 data: struct { 3551 structMarshalJSONPtrOmitEmpty 3552 }{ 3553 structMarshalJSONPtrOmitEmpty: structMarshalJSONPtrOmitEmpty{A: nil}, 3554 }, 3555 }, 3556 { 3557 name: "AnonymousHeadMarshalJSONPtrNilOnlyString", 3558 data: struct { 3559 structMarshalJSONPtrString 3560 }{ 3561 structMarshalJSONPtrString: structMarshalJSONPtrString{A: nil}, 3562 }, 3563 }, 3564 { 3565 name: "AnonymousHeadPtrMarshalJSONPtrNilOnly", 3566 data: struct { 3567 structPtrMarshalJSONPtr 3568 }{ 3569 structPtrMarshalJSONPtr: structPtrMarshalJSONPtr{A: nil}, 3570 }, 3571 }, 3572 { 3573 name: "AnonymousHeadPtrMarshalJSONPtrNilOnlyOmitEmpty", 3574 data: struct { 3575 structPtrMarshalJSONPtrOmitEmpty 3576 }{ 3577 structPtrMarshalJSONPtrOmitEmpty: structPtrMarshalJSONPtrOmitEmpty{A: nil}, 3578 }, 3579 }, 3580 { 3581 name: "AnonymousHeadPtrMarshalJSONPtrNilOnlyString", 3582 data: struct { 3583 structPtrMarshalJSONPtrString 3584 }{ 3585 structPtrMarshalJSONPtrString: structPtrMarshalJSONPtrString{A: nil}, 3586 }, 3587 }, 3588 3589 // PtrAnonymousHeadMarshalJSONPtrOnly 3590 { 3591 name: "PtrAnonymousHeadMarshalJSONPtrOnly", 3592 data: struct { 3593 *structMarshalJSONPtr 3594 }{ 3595 structMarshalJSONPtr: &structMarshalJSONPtr{A: &coverMarshalJSON{}}, 3596 }, 3597 }, 3598 { 3599 name: "PtrAnonymousHeadMarshalJSONPtrOnlyOmitEmpty", 3600 data: struct { 3601 *structMarshalJSONPtrOmitEmpty 3602 }{ 3603 structMarshalJSONPtrOmitEmpty: &structMarshalJSONPtrOmitEmpty{A: &coverMarshalJSON{}}, 3604 }, 3605 }, 3606 { 3607 name: "PtrAnonymousHeadMarshalJSONPtrOnlyString", 3608 data: struct { 3609 *structMarshalJSONPtrString 3610 }{ 3611 structMarshalJSONPtrString: &structMarshalJSONPtrString{A: &coverMarshalJSON{}}, 3612 }, 3613 }, 3614 { 3615 name: "PtrAnonymousHeadPtrMarshalJSONPtrOnly", 3616 data: struct { 3617 *structPtrMarshalJSONPtr 3618 }{ 3619 structPtrMarshalJSONPtr: &structPtrMarshalJSONPtr{A: &coverPtrMarshalJSON{}}, 3620 }, 3621 }, 3622 { 3623 name: "PtrAnonymousHeadPtrMarshalJSONPtrOnlyOmitEmpty", 3624 data: struct { 3625 *structPtrMarshalJSONPtrOmitEmpty 3626 }{ 3627 structPtrMarshalJSONPtrOmitEmpty: &structPtrMarshalJSONPtrOmitEmpty{A: &coverPtrMarshalJSON{}}, 3628 }, 3629 }, 3630 { 3631 name: "PtrAnonymousHeadPtrMarshalJSONPtrOnlyString", 3632 data: struct { 3633 *structPtrMarshalJSONPtrString 3634 }{ 3635 structPtrMarshalJSONPtrString: &structPtrMarshalJSONPtrString{A: &coverPtrMarshalJSON{}}, 3636 }, 3637 }, 3638 3639 // NilPtrAnonymousHeadMarshalJSONPtrOnly 3640 { 3641 name: "NilPtrAnonymousHeadMarshalJSONPtrOnly", 3642 data: struct { 3643 *structMarshalJSONPtr 3644 }{ 3645 structMarshalJSONPtr: nil, 3646 }, 3647 }, 3648 { 3649 name: "NilPtrAnonymousHeadMarshalJSONPtrOnlyOmitEmpty", 3650 data: struct { 3651 *structMarshalJSONPtrOmitEmpty 3652 }{ 3653 structMarshalJSONPtrOmitEmpty: nil, 3654 }, 3655 }, 3656 { 3657 name: "NilPtrAnonymousHeadMarshalJSONPtrOnlyString", 3658 data: struct { 3659 *structMarshalJSONPtrString 3660 }{ 3661 structMarshalJSONPtrString: nil, 3662 }, 3663 }, 3664 { 3665 name: "NilPtrAnonymousHeadPtrMarshalJSONPtrOnly", 3666 data: struct { 3667 *structPtrMarshalJSONPtr 3668 }{ 3669 structPtrMarshalJSONPtr: nil, 3670 }, 3671 }, 3672 { 3673 name: "NilPtrAnonymousHeadPtrMarshalJSONPtrOnlyOmitEmpty", 3674 data: struct { 3675 *structPtrMarshalJSONPtrOmitEmpty 3676 }{ 3677 structPtrMarshalJSONPtrOmitEmpty: nil, 3678 }, 3679 }, 3680 { 3681 name: "NilPtrAnonymousHeadPtrMarshalJSONPtrOnlyString", 3682 data: struct { 3683 *structPtrMarshalJSONPtrString 3684 }{ 3685 structPtrMarshalJSONPtrString: nil, 3686 }, 3687 }, 3688 } 3689 for _, test := range tests { 3690 t.Run(test.name, func(t *testing.T) { 3691 for _, indent := range []bool{true, false} { 3692 for _, htmlEscape := range []bool{true, false} { 3693 t.Run(fmt.Sprintf("%s_indent_%t_escape_%t", test.name, indent, htmlEscape), func(t *testing.T) { 3694 var buf bytes.Buffer 3695 enc := json.NewEncoder(&buf) 3696 enc.SetEscapeHTML(htmlEscape) 3697 if indent { 3698 enc.SetIndent("", " ") 3699 } 3700 if err := enc.Encode(test.data); err != nil { 3701 t.Fatalf("%s(htmlEscape:%v,indent:%v): %+v: %s", test.name, htmlEscape, indent, test.data, err) 3702 } 3703 stdresult := encodeByEncodingJSON(test.data, indent, htmlEscape) 3704 if buf.String() != stdresult { 3705 t.Errorf("%s(htmlEscape:%v,indent:%v): doesn't compatible with encoding/json. expected %q but got %q", test.name, htmlEscape, indent, stdresult, buf.String()) 3706 } 3707 }) 3708 } 3709 } 3710 }) 3711 } 3712 }