@@ -725,37 +725,37 @@ func TestMarshalErrorItems(t *testing.T) {
725
725
// Unmarshalling error cases.
726
726
727
727
type unmarshalErrorType struct {
728
- obj interface {}
729
- data string
730
- error string
728
+ obj interface {}
729
+ data string
731
730
}
732
731
733
732
var unmarshalErrorItems = []unmarshalErrorType {
734
733
// Tag name conflicts with existing parameter.
735
- {& structWithDupKeys {},
736
- " \x10 name \x00 \x08 \x00 \x00 \x00 " ,
737
- "Duplicated key 'name' in struct bson_test.structWithDupKeys" } ,
738
-
739
- {nil ,
740
- " \xEE name \x00 " ,
741
- "Unknown element kind \\ (0xEE \\ )" } ,
742
-
743
- {struct { Name bool }{},
744
- " \x10 name \x00 \x08 \x00 \x00 \x00 " ,
745
- "unmarshal can't deal with struct values. Use a pointer" } ,
746
-
747
- {123 ,
748
- " \x10 name \x00 \x08 \x00 \x00 \x00 " ,
749
- "unmarshal needs a map or a pointer to a struct" } ,
750
-
751
- {nil ,
752
- " \x08 \x62 \x00 \x02 " ,
753
- "encoded boolean must be 1 or 0, found 2" } ,
754
-
734
+ {
735
+ obj : & structWithDupKeys {} ,
736
+ data : " \x10 name \x00 \x08 \x00 \x00 \x00 " ,
737
+ },
738
+ {
739
+ obj : nil ,
740
+ data : " \xEE name \x00 " ,
741
+ },
742
+ {
743
+ obj : struct { Name bool }{} ,
744
+ data : " \x10 name \x00 \x08 \x00 \x00 \x00 " ,
745
+ },
746
+ {
747
+ obj : 123 ,
748
+ data : " \x10 name \x00 \x08 \x00 \x00 \x00 " ,
749
+ },
750
+ {
751
+ obj : nil ,
752
+ data : " \x08 \x62 \x00 \x02 " ,
753
+ },
755
754
// Non-string and not numeric map key.
756
- {map [bool ]interface {}{true : 1 },
757
- "\x10 true\x00 \x01 \x00 \x00 \x00 " ,
758
- "BSON map must have string or decimal keys. Got: map\\ [bool\\ ]interface \\ {\\ }" },
755
+ {
756
+ obj : map [bool ]interface {}{true : 1 },
757
+ data : "\x10 true\x00 \x01 \x00 \x00 \x00 " ,
758
+ },
759
759
}
760
760
761
761
func TestUnmarshalErrorItems (t * testing.T ) {
@@ -778,28 +778,28 @@ func TestUnmarshalErrorItems(t *testing.T) {
778
778
}
779
779
780
780
type unmarshalRawErrorType struct {
781
- obj interface {}
782
- raw bson.RawValue
783
- error string
781
+ obj interface {}
782
+ raw bson.RawValue
784
783
}
785
784
786
785
var unmarshalRawErrorItems = []unmarshalRawErrorType {
787
786
// Tag name conflicts with existing parameter.
788
- {& structWithDupKeys {},
789
- bson.RawValue {Type : 0x03 , Value : []byte ("\x10 byte\x00 \x08 \x00 \x00 \x00 " )},
790
- "Duplicated key 'name' in struct bson_test.structWithDupKeys" },
791
-
792
- {& struct {}{},
793
- bson.RawValue {Type : 0xEE , Value : []byte {}},
794
- "Unknown element kind \\ (0xEE\\ )" },
795
-
796
- {struct { Name bool }{},
797
- bson.RawValue {Type : 0x10 , Value : []byte ("\x08 \x00 \x00 \x00 " )},
798
- "raw Unmarshal can't deal with struct values. Use a pointer" },
799
-
800
- {123 ,
801
- bson.RawValue {Type : 0x10 , Value : []byte ("\x08 \x00 \x00 \x00 " )},
802
- "raw Unmarshal needs a map or a valid pointer" },
787
+ {
788
+ obj : & structWithDupKeys {},
789
+ raw : bson.RawValue {Type : 0x03 , Value : []byte ("\x10 byte\x00 \x08 \x00 \x00 \x00 " )},
790
+ },
791
+ {
792
+ obj : & struct {}{},
793
+ raw : bson.RawValue {Type : 0xEE , Value : []byte {}},
794
+ },
795
+ {
796
+ obj : struct { Name bool }{},
797
+ raw : bson.RawValue {Type : 0x10 , Value : []byte ("\x08 \x00 \x00 \x00 " )},
798
+ },
799
+ {
800
+ obj : 123 ,
801
+ raw : bson.RawValue {Type : 0x10 , Value : []byte ("\x08 \x00 \x00 \x00 " )},
802
+ },
803
803
}
804
804
805
805
func TestUnmarshalRawErrorItems (t * testing.T ) {
0 commit comments