Skip to content

Commit 546b6b1

Browse files
committed
t.Assert(err, nil) -> t.AssertNil(err)
1 parent eca3583 commit 546b6b1

File tree

118 files changed

+779
-779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+779
-779
lines changed

container/garray/garray_z_unit_normal_any_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ func TestArray_Json(t *testing.T) {
576576

577577
var a3 garray.Array
578578
err := json.UnmarshalUseNumber(b2, &a3)
579-
t.Assert(err, nil)
579+
t.AssertNil(err)
580580
t.Assert(a3.Slice(), s1)
581581
})
582582
// value.
@@ -595,7 +595,7 @@ func TestArray_Json(t *testing.T) {
595595

596596
var a3 garray.Array
597597
err := json.UnmarshalUseNumber(b2, &a3)
598-
t.Assert(err, nil)
598+
t.AssertNil(err)
599599
t.Assert(a3.Slice(), s1)
600600
})
601601
// pointer
@@ -609,11 +609,11 @@ func TestArray_Json(t *testing.T) {
609609
"Scores": []int{99, 100, 98},
610610
}
611611
b, err := json.Marshal(data)
612-
t.Assert(err, nil)
612+
t.AssertNil(err)
613613

614614
user := new(User)
615615
err = json.UnmarshalUseNumber(b, user)
616-
t.Assert(err, nil)
616+
t.AssertNil(err)
617617
t.Assert(user.Name, data["Name"])
618618
t.Assert(user.Scores, data["Scores"])
619619
})
@@ -628,11 +628,11 @@ func TestArray_Json(t *testing.T) {
628628
"Scores": []int{99, 100, 98},
629629
}
630630
b, err := json.Marshal(data)
631-
t.Assert(err, nil)
631+
t.AssertNil(err)
632632

633633
user := new(User)
634634
err = json.UnmarshalUseNumber(b, user)
635-
t.Assert(err, nil)
635+
t.AssertNil(err)
636636
t.Assert(user.Name, data["Name"])
637637
t.Assert(user.Scores, data["Scores"])
638638
})
@@ -720,7 +720,7 @@ func TestArray_UnmarshalValue(t *testing.T) {
720720
"name": "john",
721721
"array": g.Slice{1, 2, 3},
722722
}, &v)
723-
t.Assert(err, nil)
723+
t.AssertNil(err)
724724
t.Assert(v.Name, "john")
725725
t.Assert(v.Array.Slice(), g.Slice{1, 2, 3})
726726
})

container/garray/garray_z_unit_normal_int_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ func TestIntArray_Json(t *testing.T) {
619619

620620
var a3 garray.IntArray
621621
err := json.UnmarshalUseNumber(b2, &a3)
622-
t.Assert(err, nil)
622+
t.AssertNil(err)
623623
t.Assert(a3.Slice(), s1)
624624
})
625625
// array value
@@ -637,7 +637,7 @@ func TestIntArray_Json(t *testing.T) {
637637

638638
var a3 garray.IntArray
639639
err := json.UnmarshalUseNumber(b2, &a3)
640-
t.Assert(err, nil)
640+
t.AssertNil(err)
641641
t.Assert(a3.Slice(), s1)
642642
})
643643
// array pointer
@@ -651,11 +651,11 @@ func TestIntArray_Json(t *testing.T) {
651651
"Scores": []int{99, 100, 98},
652652
}
653653
b, err := json.Marshal(data)
654-
t.Assert(err, nil)
654+
t.AssertNil(err)
655655

656656
user := new(User)
657657
err = json.UnmarshalUseNumber(b, user)
658-
t.Assert(err, nil)
658+
t.AssertNil(err)
659659
t.Assert(user.Name, data["Name"])
660660
t.Assert(user.Scores, data["Scores"])
661661
})
@@ -670,11 +670,11 @@ func TestIntArray_Json(t *testing.T) {
670670
"Scores": []int{99, 100, 98},
671671
}
672672
b, err := json.Marshal(data)
673-
t.Assert(err, nil)
673+
t.AssertNil(err)
674674

675675
user := new(User)
676676
err = json.UnmarshalUseNumber(b, user)
677-
t.Assert(err, nil)
677+
t.AssertNil(err)
678678
t.Assert(user.Name, data["Name"])
679679
t.Assert(user.Scores, data["Scores"])
680680
})
@@ -752,7 +752,7 @@ func TestIntArray_UnmarshalValue(t *testing.T) {
752752
"name": "john",
753753
"array": []byte(`[1,2,3]`),
754754
}, &v)
755-
t.Assert(err, nil)
755+
t.AssertNil(err)
756756
t.Assert(v.Name, "john")
757757
t.Assert(v.Array.Slice(), g.Slice{1, 2, 3})
758758
})
@@ -763,7 +763,7 @@ func TestIntArray_UnmarshalValue(t *testing.T) {
763763
// "name": "john",
764764
// "array": g.Slice{1, 2, 3},
765765
// }, &v)
766-
// t.Assert(err, nil)
766+
// t.AssertNil(err)
767767
// t.Assert(v.Name, "john")
768768
// t.Assert(v.Array.Slice(), g.Slice{1, 2, 3})
769769
// })

container/garray/garray_z_unit_normal_str_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ func TestStrArray_Json(t *testing.T) {
619619

620620
var a3 garray.StrArray
621621
err := json.UnmarshalUseNumber(b2, &a3)
622-
t.Assert(err, nil)
622+
t.AssertNil(err)
623623
t.Assert(a3.Slice(), s1)
624624
})
625625
// array value
@@ -637,7 +637,7 @@ func TestStrArray_Json(t *testing.T) {
637637

638638
var a3 garray.StrArray
639639
err := json.UnmarshalUseNumber(b2, &a3)
640-
t.Assert(err, nil)
640+
t.AssertNil(err)
641641
t.Assert(a3.Slice(), s1)
642642
})
643643
// array pointer
@@ -651,11 +651,11 @@ func TestStrArray_Json(t *testing.T) {
651651
"Scores": []string{"A+", "A", "A"},
652652
}
653653
b, err := json.Marshal(data)
654-
t.Assert(err, nil)
654+
t.AssertNil(err)
655655

656656
user := new(User)
657657
err = json.UnmarshalUseNumber(b, user)
658-
t.Assert(err, nil)
658+
t.AssertNil(err)
659659
t.Assert(user.Name, data["Name"])
660660
t.Assert(user.Scores, data["Scores"])
661661
})
@@ -670,11 +670,11 @@ func TestStrArray_Json(t *testing.T) {
670670
"Scores": []string{"A+", "A", "A"},
671671
}
672672
b, err := json.Marshal(data)
673-
t.Assert(err, nil)
673+
t.AssertNil(err)
674674

675675
user := new(User)
676676
err = json.UnmarshalUseNumber(b, user)
677-
t.Assert(err, nil)
677+
t.AssertNil(err)
678678
t.Assert(user.Name, data["Name"])
679679
t.Assert(user.Scores, data["Scores"])
680680
})
@@ -751,7 +751,7 @@ func TestStrArray_UnmarshalValue(t *testing.T) {
751751
"name": "john",
752752
"array": []byte(`["1","2","3"]`),
753753
}, &v)
754-
t.Assert(err, nil)
754+
t.AssertNil(err)
755755
t.Assert(v.Name, "john")
756756
t.Assert(v.Array.Slice(), g.SliceStr{"1", "2", "3"})
757757
})
@@ -762,7 +762,7 @@ func TestStrArray_UnmarshalValue(t *testing.T) {
762762
"name": "john",
763763
"array": g.SliceStr{"1", "2", "3"},
764764
}, &v)
765-
t.Assert(err, nil)
765+
t.AssertNil(err)
766766
t.Assert(v.Name, "john")
767767
t.Assert(v.Array.Slice(), g.SliceStr{"1", "2", "3"})
768768
})

container/garray/garray_z_unit_sorted_any_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ func TestSortedArray_Json(t *testing.T) {
661661

662662
var a3 garray.SortedArray
663663
err := json.UnmarshalUseNumber(b2, &a3)
664-
t.Assert(err, nil)
664+
t.AssertNil(err)
665665
t.Assert(a3.Slice(), s1)
666666
t.Assert(a3.Interfaces(), s1)
667667
})
@@ -681,7 +681,7 @@ func TestSortedArray_Json(t *testing.T) {
681681

682682
var a3 garray.SortedArray
683683
err := json.UnmarshalUseNumber(b2, &a3)
684-
t.Assert(err, nil)
684+
t.AssertNil(err)
685685
t.Assert(a3.Slice(), s1)
686686
t.Assert(a3.Interfaces(), s1)
687687
})
@@ -696,11 +696,11 @@ func TestSortedArray_Json(t *testing.T) {
696696
"Scores": []int{99, 100, 98},
697697
}
698698
b, err := json.Marshal(data)
699-
t.Assert(err, nil)
699+
t.AssertNil(err)
700700

701701
user := new(User)
702702
err = json.UnmarshalUseNumber(b, user)
703-
t.Assert(err, nil)
703+
t.AssertNil(err)
704704
t.Assert(user.Name, data["Name"])
705705
t.AssertNE(user.Scores, nil)
706706
t.Assert(user.Scores.Len(), 3)
@@ -732,11 +732,11 @@ func TestSortedArray_Json(t *testing.T) {
732732
"Scores": []int{99, 100, 98},
733733
}
734734
b, err := json.Marshal(data)
735-
t.Assert(err, nil)
735+
t.AssertNil(err)
736736

737737
user := new(User)
738738
err = json.UnmarshalUseNumber(b, user)
739-
t.Assert(err, nil)
739+
t.AssertNil(err)
740740
t.Assert(user.Name, data["Name"])
741741
t.AssertNE(user.Scores, nil)
742742
t.Assert(user.Scores.Len(), 3)
@@ -830,7 +830,7 @@ func TestSortedArray_UnmarshalValue(t *testing.T) {
830830
"name": "john",
831831
"array": []byte(`[2,3,1]`),
832832
}, &v)
833-
t.Assert(err, nil)
833+
t.AssertNil(err)
834834
t.Assert(v.Name, "john")
835835
t.Assert(v.Array.Slice(), g.Slice{1, 2, 3})
836836
})
@@ -841,7 +841,7 @@ func TestSortedArray_UnmarshalValue(t *testing.T) {
841841
"name": "john",
842842
"array": g.Slice{2, 3, 1},
843843
}, &v)
844-
t.Assert(err, nil)
844+
t.AssertNil(err)
845845
t.Assert(v.Name, "john")
846846
t.Assert(v.Array.Slice(), g.Slice{1, 2, 3})
847847
})

container/garray/garray_z_unit_sorted_int_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ func TestSortedIntArray_Json(t *testing.T) {
561561

562562
var a3 garray.SortedIntArray
563563
err := json.UnmarshalUseNumber(b2, &a3)
564-
t.Assert(err, nil)
564+
t.AssertNil(err)
565565
t.Assert(a3.Slice(), s1)
566566
})
567567
// array value
@@ -580,7 +580,7 @@ func TestSortedIntArray_Json(t *testing.T) {
580580

581581
var a3 garray.SortedIntArray
582582
err := json.UnmarshalUseNumber(b2, &a3)
583-
t.Assert(err, nil)
583+
t.AssertNil(err)
584584
t.Assert(a3.Slice(), s1)
585585
})
586586
// array pointer
@@ -594,11 +594,11 @@ func TestSortedIntArray_Json(t *testing.T) {
594594
"Scores": []int{99, 100, 98},
595595
}
596596
b, err := json.Marshal(data)
597-
t.Assert(err, nil)
597+
t.AssertNil(err)
598598

599599
user := new(User)
600600
err = json.UnmarshalUseNumber(b, user)
601-
t.Assert(err, nil)
601+
t.AssertNil(err)
602602
t.Assert(user.Name, data["Name"])
603603
t.Assert(user.Scores, []int{98, 99, 100})
604604
})
@@ -613,11 +613,11 @@ func TestSortedIntArray_Json(t *testing.T) {
613613
"Scores": []int{99, 100, 98},
614614
}
615615
b, err := json.Marshal(data)
616-
t.Assert(err, nil)
616+
t.AssertNil(err)
617617

618618
user := new(User)
619619
err = json.UnmarshalUseNumber(b, user)
620-
t.Assert(err, nil)
620+
t.AssertNil(err)
621621
t.Assert(user.Name, data["Name"])
622622
t.Assert(user.Scores, []int{98, 99, 100})
623623
})
@@ -695,7 +695,7 @@ func TestSortedIntArray_UnmarshalValue(t *testing.T) {
695695
"name": "john",
696696
"array": []byte(`[2,3,1]`),
697697
}, &v)
698-
t.Assert(err, nil)
698+
t.AssertNil(err)
699699
t.Assert(v.Name, "john")
700700
t.Assert(v.Array.Slice(), g.Slice{1, 2, 3})
701701
})
@@ -706,7 +706,7 @@ func TestSortedIntArray_UnmarshalValue(t *testing.T) {
706706
"name": "john",
707707
"array": g.Slice{2, 3, 1},
708708
}, &v)
709-
t.Assert(err, nil)
709+
t.AssertNil(err)
710710
t.Assert(v.Name, "john")
711711
t.Assert(v.Array.Slice(), g.Slice{1, 2, 3})
712712
})

container/garray/garray_z_unit_sorted_str_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ func TestSortedStrArray_Json(t *testing.T) {
583583

584584
var a3 garray.SortedStrArray
585585
err := json.UnmarshalUseNumber(b2, &a3)
586-
t.Assert(err, nil)
586+
t.AssertNil(err)
587587
t.Assert(a3.Slice(), s1)
588588
t.Assert(a3.Interfaces(), s1)
589589
})
@@ -604,7 +604,7 @@ func TestSortedStrArray_Json(t *testing.T) {
604604

605605
var a3 garray.SortedStrArray
606606
err := json.UnmarshalUseNumber(b2, &a3)
607-
t.Assert(err, nil)
607+
t.AssertNil(err)
608608
t.Assert(a3.Slice(), s1)
609609
t.Assert(a3.Interfaces(), s1)
610610
})
@@ -619,11 +619,11 @@ func TestSortedStrArray_Json(t *testing.T) {
619619
"Scores": []string{"A+", "A", "A"},
620620
}
621621
b, err := json.Marshal(data)
622-
t.Assert(err, nil)
622+
t.AssertNil(err)
623623

624624
user := new(User)
625625
err = json.UnmarshalUseNumber(b, user)
626-
t.Assert(err, nil)
626+
t.AssertNil(err)
627627
t.Assert(user.Name, data["Name"])
628628
t.Assert(user.Scores, []string{"A", "A", "A+"})
629629
})
@@ -638,11 +638,11 @@ func TestSortedStrArray_Json(t *testing.T) {
638638
"Scores": []string{"A+", "A", "A"},
639639
}
640640
b, err := json.Marshal(data)
641-
t.Assert(err, nil)
641+
t.AssertNil(err)
642642

643643
user := new(User)
644644
err = json.UnmarshalUseNumber(b, user)
645-
t.Assert(err, nil)
645+
t.AssertNil(err)
646646
t.Assert(user.Name, data["Name"])
647647
t.Assert(user.Scores, []string{"A", "A", "A+"})
648648
})
@@ -719,7 +719,7 @@ func TestSortedStrArray_UnmarshalValue(t *testing.T) {
719719
"name": "john",
720720
"array": []byte(`["1","3","2"]`),
721721
}, &v)
722-
t.Assert(err, nil)
722+
t.AssertNil(err)
723723
t.Assert(v.Name, "john")
724724
t.Assert(v.Array.Slice(), g.SliceStr{"1", "2", "3"})
725725
})
@@ -730,7 +730,7 @@ func TestSortedStrArray_UnmarshalValue(t *testing.T) {
730730
"name": "john",
731731
"array": g.SliceStr{"1", "3", "2"},
732732
}, &v)
733-
t.Assert(err, nil)
733+
t.AssertNil(err)
734734
t.Assert(v.Name, "john")
735735
t.Assert(v.Array.Slice(), g.SliceStr{"1", "2", "3"})
736736
})

0 commit comments

Comments
 (0)