@@ -46,26 +46,26 @@ func TestStructTagParsers(t *testing.T) {
4646 },
4747 {
4848 "default all options" ,
49- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bar,omitempty,minsize,truncate,inline` )},
50- & structTags {Name : "bar" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
49+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bar,omitempty,omitzero, minsize,truncate,inline` )},
50+ & structTags {Name : "bar" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
5151 parseStructTags ,
5252 },
5353 {
5454 "default all options default name" ,
55- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`,omitempty,minsize,truncate,inline` )},
56- & structTags {Name : "foo" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
55+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`,omitempty,omitzero, minsize,truncate,inline` )},
56+ & structTags {Name : "foo" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
5757 parseStructTags ,
5858 },
5959 {
6060 "default bson tag all options" ,
61- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bson:"bar,omitempty,minsize,truncate,inline"` )},
62- & structTags {Name : "bar" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
61+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bson:"bar,omitempty,omitzero, minsize,truncate,inline"` )},
62+ & structTags {Name : "bar" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
6363 parseStructTags ,
6464 },
6565 {
6666 "default bson tag all options default name" ,
67- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bson:",omitempty,minsize,truncate,inline"` )},
68- & structTags {Name : "foo" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
67+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bson:",omitempty,omitzero, minsize,truncate,inline"` )},
68+ & structTags {Name : "foo" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
6969 parseStructTags ,
7070 },
7171 {
@@ -100,38 +100,38 @@ func TestStructTagParsers(t *testing.T) {
100100 },
101101 {
102102 "JSONFallback all options" ,
103- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bar,omitempty,minsize,truncate,inline` )},
104- & structTags {Name : "bar" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
103+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bar,omitempty,omitzero, minsize,truncate,inline` )},
104+ & structTags {Name : "bar" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
105105 parseJSONStructTags ,
106106 },
107107 {
108108 "JSONFallback all options default name" ,
109- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`,omitempty,minsize,truncate,inline` )},
110- & structTags {Name : "foo" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
109+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`,omitempty,omitzero, minsize,truncate,inline` )},
110+ & structTags {Name : "foo" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
111111 parseJSONStructTags ,
112112 },
113113 {
114114 "JSONFallback bson tag all options" ,
115- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bson:"bar,omitempty,minsize,truncate,inline"` )},
116- & structTags {Name : "bar" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
115+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bson:"bar,omitempty,omitzero, minsize,truncate,inline"` )},
116+ & structTags {Name : "bar" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
117117 parseJSONStructTags ,
118118 },
119119 {
120120 "JSONFallback bson tag all options default name" ,
121- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bson:",omitempty,minsize,truncate,inline"` )},
122- & structTags {Name : "foo" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
121+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`bson:",omitempty,omitzero, minsize,truncate,inline"` )},
122+ & structTags {Name : "foo" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
123123 parseJSONStructTags ,
124124 },
125125 {
126126 "JSONFallback json tag all options" ,
127- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`json:"bar,omitempty,minsize,truncate,inline"` )},
128- & structTags {Name : "bar" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
127+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`json:"bar,omitempty,omitzero, minsize,truncate,inline"` )},
128+ & structTags {Name : "bar" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
129129 parseJSONStructTags ,
130130 },
131131 {
132132 "JSONFallback json tag all options default name" ,
133- reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`json:",omitempty,minsize,truncate,inline"` )},
134- & structTags {Name : "foo" , OmitEmpty : true , MinSize : true , Truncate : true , Inline : true },
133+ reflect.StructField {Name : "foo" , Tag : reflect .StructTag (`json:",omitempty,omitzero, minsize,truncate,inline"` )},
134+ & structTags {Name : "foo" , OmitEmpty : true , OmitZero : true , MinSize : true , Truncate : true , Inline : true },
135135 parseJSONStructTags ,
136136 },
137137 {
0 commit comments