@@ -21,50 +21,50 @@ func TestDocumentBuilder(t *testing.T) {
2121
2222 testCases := []struct {
2323 name string
24- fn interface {}
25- params []interface {}
24+ fn any
25+ params []any
2626 expected []byte
2727 }{
2828 {
2929 "AppendInt32" ,
3030 NewDocumentBuilder ().AppendInt32 ,
31- []interface {} {"foobar" , int32 (256 )},
31+ []any {"foobar" , int32 (256 )},
3232 BuildDocumentFromElements (nil , AppendInt32Element (nil , "foobar" , 256 )),
3333 },
3434 {
3535 "AppendDouble" ,
3636 NewDocumentBuilder ().AppendDouble ,
37- []interface {} {"foobar" , float64 (3.14159 )},
37+ []any {"foobar" , float64 (3.14159 )},
3838 BuildDocumentFromElements (nil , AppendDoubleElement (nil , "foobar" , float64 (3.14159 ))),
3939 },
4040 {
4141 "AppendString" ,
4242 NewDocumentBuilder ().AppendString ,
43- []interface {} {"foobar" , "x" },
43+ []any {"foobar" , "x" },
4444 BuildDocumentFromElements (nil , AppendStringElement (nil , "foobar" , "x" )),
4545 },
4646 {
4747 "AppendDocument" ,
4848 NewDocumentBuilder ().AppendDocument ,
49- []interface {} {"foobar" , []byte {0x05 , 0x00 , 0x00 , 0x00 , 0x00 }},
49+ []any {"foobar" , []byte {0x05 , 0x00 , 0x00 , 0x00 , 0x00 }},
5050 BuildDocumentFromElements (nil , AppendDocumentElement (nil , "foobar" , []byte {0x05 , 0x00 , 0x00 , 0x00 , 0x00 })),
5151 },
5252 {
5353 "AppendArray" ,
5454 NewDocumentBuilder ().AppendArray ,
55- []interface {} {"foobar" , []byte {0x05 , 0x00 , 0x00 , 0x00 , 0x00 }},
55+ []any {"foobar" , []byte {0x05 , 0x00 , 0x00 , 0x00 , 0x00 }},
5656 BuildDocumentFromElements (nil , AppendArrayElement (nil , "foobar" , []byte {0x05 , 0x00 , 0x00 , 0x00 , 0x00 })),
5757 },
5858 {
5959 "AppendBinary" ,
6060 NewDocumentBuilder ().AppendBinary ,
61- []interface {} {"foobar" , byte (0x02 ), []byte {0x01 , 0x02 , 0x03 }},
61+ []any {"foobar" , byte (0x02 ), []byte {0x01 , 0x02 , 0x03 }},
6262 BuildDocumentFromElements (nil , AppendBinaryElement (nil , "foobar" , byte (0x02 ), []byte {0x01 , 0x02 , 0x03 })),
6363 },
6464 {
6565 "AppendObjectID" ,
6666 NewDocumentBuilder ().AppendObjectID ,
67- []interface {} {
67+ []any {
6868 "foobar" ,
6969 [12 ]byte {0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0x0C },
7070 },
@@ -74,87 +74,87 @@ func TestDocumentBuilder(t *testing.T) {
7474 {
7575 "AppendBoolean" ,
7676 NewDocumentBuilder ().AppendBoolean ,
77- []interface {} {"foobar" , true },
77+ []any {"foobar" , true },
7878 BuildDocumentFromElements (nil , AppendBooleanElement (nil , "foobar" , true )),
7979 },
8080 {
8181 "AppendDateTime" ,
8282 NewDocumentBuilder ().AppendDateTime ,
83- []interface {} {"foobar" , int64 (256 )},
83+ []any {"foobar" , int64 (256 )},
8484 BuildDocumentFromElements (nil , AppendDateTimeElement (nil , "foobar" , int64 (256 ))),
8585 },
8686 {
8787 "AppendNull" ,
8888 NewDocumentBuilder ().AppendNull ,
89- []interface {} {"foobar" },
89+ []any {"foobar" },
9090 BuildDocumentFromElements (nil , AppendNullElement (nil , "foobar" )),
9191 },
9292 {
9393 "AppendRegex" ,
9494 NewDocumentBuilder ().AppendRegex ,
95- []interface {} {"foobar" , "bar" , "baz" },
95+ []any {"foobar" , "bar" , "baz" },
9696 BuildDocumentFromElements (nil , AppendRegexElement (nil , "foobar" , "bar" , "baz" )),
9797 },
9898 {
9999 "AppendJavaScript" ,
100100 NewDocumentBuilder ().AppendJavaScript ,
101- []interface {} {"foobar" , "barbaz" },
101+ []any {"foobar" , "barbaz" },
102102 BuildDocumentFromElements (nil , AppendJavaScriptElement (nil , "foobar" , "barbaz" )),
103103 },
104104 {
105105 "AppendCodeWithScope" ,
106106 NewDocumentBuilder ().AppendCodeWithScope ,
107- []interface {} {"foobar" , "barbaz" , Document ([]byte {0x05 , 0x00 , 0x00 , 0x00 , 0x00 })},
107+ []any {"foobar" , "barbaz" , Document ([]byte {0x05 , 0x00 , 0x00 , 0x00 , 0x00 })},
108108 BuildDocumentFromElements (nil , AppendCodeWithScopeElement (nil , "foobar" , "barbaz" , Document ([]byte {0x05 , 0x00 , 0x00 , 0x00 , 0x00 }))),
109109 },
110110 {
111111 "AppendTimestamp" ,
112112 NewDocumentBuilder ().AppendTimestamp ,
113- []interface {} {"foobar" , uint32 (65536 ), uint32 (256 )},
113+ []any {"foobar" , uint32 (65536 ), uint32 (256 )},
114114 BuildDocumentFromElements (nil , AppendTimestampElement (nil , "foobar" , uint32 (65536 ), uint32 (256 ))),
115115 },
116116 {
117117 "AppendInt64" ,
118118 NewDocumentBuilder ().AppendInt64 ,
119- []interface {} {"foobar" , int64 (4294967296 )},
119+ []any {"foobar" , int64 (4294967296 )},
120120 BuildDocumentFromElements (nil , AppendInt64Element (nil , "foobar" , int64 (4294967296 ))),
121121 },
122122 {
123123 "AppendDecimal128" ,
124124 NewDocumentBuilder ().AppendDecimal128 ,
125- []interface {} {"foobar" , uint64 (4294967296 ), uint64 (65536 )},
125+ []any {"foobar" , uint64 (4294967296 ), uint64 (65536 )},
126126 BuildDocumentFromElements (nil , AppendDecimal128Element (nil , "foobar" , 4294967296 , 65536 )),
127127 },
128128 {
129129 "AppendMaxKey" ,
130130 NewDocumentBuilder ().AppendMaxKey ,
131- []interface {} {"foobar" },
131+ []any {"foobar" },
132132 BuildDocumentFromElements (nil , AppendMaxKeyElement (nil , "foobar" )),
133133 },
134134 {
135135 "AppendMinKey" ,
136136 NewDocumentBuilder ().AppendMinKey ,
137- []interface {} {"foobar" },
137+ []any {"foobar" },
138138 BuildDocumentFromElements (nil , AppendMinKeyElement (nil , "foobar" )),
139139 },
140140 {
141141 "AppendSymbol" ,
142142 NewDocumentBuilder ().AppendSymbol ,
143- []interface {} {"foobar" , "barbaz" },
143+ []any {"foobar" , "barbaz" },
144144 BuildDocumentFromElements (nil , AppendSymbolElement (nil , "foobar" , "barbaz" )),
145145 },
146146 {
147147 "AppendDBPointer" ,
148148 NewDocumentBuilder ().AppendDBPointer ,
149- []interface {} {"foobar" , "barbaz" ,
149+ []any {"foobar" , "barbaz" ,
150150 [12 ]byte {0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0x0C }},
151151 BuildDocumentFromElements (nil , AppendDBPointerElement (nil , "foobar" , "barbaz" ,
152152 [12 ]byte {0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0x0C })),
153153 },
154154 {
155155 "AppendUndefined" ,
156156 NewDocumentBuilder ().AppendUndefined ,
157- []interface {} {"foobar" },
157+ []any {"foobar" },
158158 BuildDocumentFromElements (nil , AppendUndefinedElement (nil , "foobar" )),
159159 },
160160 }
0 commit comments