@@ -20,8 +20,8 @@ func paramsToJSON(params map[string]*Ydb.TypedValue) string {
2020
2121func TestBuilder (t * testing.T ) {
2222 type expected struct {
23- kind * Ydb.Type
24- value * Ydb.Value
23+ Type * Ydb.Type
24+ Value * Ydb.Value
2525 }
2626
2727 tests := []struct {
@@ -35,10 +35,10 @@ func TestBuilder(t *testing.T) {
3535 args : []any {uint64 (123 )},
3636
3737 expected : expected {
38- kind : & Ydb.Type {
38+ Type : & Ydb.Type {
3939 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_UINT64 },
4040 },
41- value : & Ydb.Value {
41+ Value : & Ydb.Value {
4242 Value : & Ydb.Value_Uint64Value {
4343 Uint64Value : 123 ,
4444 },
@@ -50,10 +50,10 @@ func TestBuilder(t *testing.T) {
5050 args : []any {int64 (123 )},
5151
5252 expected : expected {
53- kind : & Ydb.Type {
53+ Type : & Ydb.Type {
5454 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_INT64 },
5555 },
56- value : & Ydb.Value {
56+ Value : & Ydb.Value {
5757 Value : & Ydb.Value_Int64Value {
5858 Int64Value : 123 ,
5959 },
@@ -65,10 +65,10 @@ func TestBuilder(t *testing.T) {
6565 args : []any {uint32 (123 )},
6666
6767 expected : expected {
68- kind : & Ydb.Type {
68+ Type : & Ydb.Type {
6969 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_UINT32 },
7070 },
71- value : & Ydb.Value {
71+ Value : & Ydb.Value {
7272 Value : & Ydb.Value_Uint32Value {
7373 Uint32Value : 123 ,
7474 },
@@ -80,10 +80,10 @@ func TestBuilder(t *testing.T) {
8080 args : []any {int32 (123 )},
8181
8282 expected : expected {
83- kind : & Ydb.Type {
83+ Type : & Ydb.Type {
8484 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_INT32 },
8585 },
86- value : & Ydb.Value {
86+ Value : & Ydb.Value {
8787 Value : & Ydb.Value_Int32Value {
8888 Int32Value : 123 ,
8989 },
@@ -95,10 +95,10 @@ func TestBuilder(t *testing.T) {
9595 args : []any {uint16 (123 )},
9696
9797 expected : expected {
98- kind : & Ydb.Type {
98+ Type : & Ydb.Type {
9999 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_UINT16 },
100100 },
101- value : & Ydb.Value {
101+ Value : & Ydb.Value {
102102 Value : & Ydb.Value_Uint32Value {
103103 Uint32Value : 123 ,
104104 },
@@ -110,10 +110,10 @@ func TestBuilder(t *testing.T) {
110110 args : []any {int16 (123 )},
111111
112112 expected : expected {
113- kind : & Ydb.Type {
113+ Type : & Ydb.Type {
114114 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_INT16 },
115115 },
116- value : & Ydb.Value {
116+ Value : & Ydb.Value {
117117 Value : & Ydb.Value_Int32Value {
118118 Int32Value : 123 ,
119119 },
@@ -125,10 +125,10 @@ func TestBuilder(t *testing.T) {
125125 args : []any {uint8 (123 )},
126126
127127 expected : expected {
128- kind : & Ydb.Type {
128+ Type : & Ydb.Type {
129129 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_UINT8 },
130130 },
131- value : & Ydb.Value {
131+ Value : & Ydb.Value {
132132 Value : & Ydb.Value_Uint32Value {
133133 Uint32Value : 123 ,
134134 },
@@ -140,10 +140,10 @@ func TestBuilder(t *testing.T) {
140140 args : []any {int8 (123 )},
141141
142142 expected : expected {
143- kind : & Ydb.Type {
143+ Type : & Ydb.Type {
144144 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_INT8 },
145145 },
146- value : & Ydb.Value {
146+ Value : & Ydb.Value {
147147 Value : & Ydb.Value_Int32Value {
148148 Int32Value : 123 ,
149149 },
@@ -155,10 +155,10 @@ func TestBuilder(t *testing.T) {
155155 args : []any {true },
156156
157157 expected : expected {
158- kind : & Ydb.Type {
158+ Type : & Ydb.Type {
159159 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_BOOL },
160160 },
161- value : & Ydb.Value {
161+ Value : & Ydb.Value {
162162 Value : & Ydb.Value_BoolValue {
163163 BoolValue : true ,
164164 },
@@ -170,10 +170,10 @@ func TestBuilder(t *testing.T) {
170170 args : []any {"test" },
171171
172172 expected : expected {
173- kind : & Ydb.Type {
173+ Type : & Ydb.Type {
174174 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_UTF8 },
175175 },
176- value : & Ydb.Value {
176+ Value : & Ydb.Value {
177177 Value : & Ydb.Value_TextValue {
178178 TextValue : "test" ,
179179 },
@@ -185,10 +185,10 @@ func TestBuilder(t *testing.T) {
185185 args : []any {[]byte ("test" )},
186186
187187 expected : expected {
188- kind : & Ydb.Type {
188+ Type : & Ydb.Type {
189189 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_STRING },
190190 },
191- value : & Ydb.Value {
191+ Value : & Ydb.Value {
192192 Value : & Ydb.Value_BytesValue {
193193 BytesValue : []byte ("test" ),
194194 },
@@ -200,10 +200,10 @@ func TestBuilder(t *testing.T) {
200200 args : []any {float32 (123 )},
201201
202202 expected : expected {
203- kind : & Ydb.Type {
203+ Type : & Ydb.Type {
204204 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_FLOAT },
205205 },
206- value : & Ydb.Value {
206+ Value : & Ydb.Value {
207207 Value : & Ydb.Value_FloatValue {
208208 FloatValue : float32 (123 ),
209209 },
@@ -215,10 +215,10 @@ func TestBuilder(t *testing.T) {
215215 args : []any {float64 (123 )},
216216
217217 expected : expected {
218- kind : & Ydb.Type {
218+ Type : & Ydb.Type {
219219 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_DOUBLE },
220220 },
221- value : & Ydb.Value {
221+ Value : & Ydb.Value {
222222 Value : & Ydb.Value_DoubleValue {
223223 DoubleValue : float64 (123 ),
224224 },
@@ -230,10 +230,10 @@ func TestBuilder(t *testing.T) {
230230 args : []any {time .Second },
231231
232232 expected : expected {
233- kind : & Ydb.Type {
233+ Type : & Ydb.Type {
234234 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_INTERVAL },
235235 },
236- value : & Ydb.Value {
236+ Value : & Ydb.Value {
237237 Value : & Ydb.Value_Int64Value {
238238 Int64Value : 1000000 ,
239239 },
@@ -245,10 +245,10 @@ func TestBuilder(t *testing.T) {
245245 args : []any {time .Unix (123456789 , 456 )},
246246
247247 expected : expected {
248- kind : & Ydb.Type {
248+ Type : & Ydb.Type {
249249 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_DATETIME },
250250 },
251- value : & Ydb.Value {
251+ Value : & Ydb.Value {
252252 Value : & Ydb.Value_Uint32Value {
253253 Uint32Value : 123456789 ,
254254 },
@@ -260,10 +260,10 @@ func TestBuilder(t *testing.T) {
260260 args : []any {time .Unix (123456789 , 456 )},
261261
262262 expected : expected {
263- kind : & Ydb.Type {
263+ Type : & Ydb.Type {
264264 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_DATE },
265265 },
266- value : & Ydb.Value {
266+ Value : & Ydb.Value {
267267 Value : & Ydb.Value_Uint32Value {
268268 Uint32Value : 1428 ,
269269 },
@@ -275,10 +275,10 @@ func TestBuilder(t *testing.T) {
275275 args : []any {time .Unix (123456789 , 456 )},
276276
277277 expected : expected {
278- kind : & Ydb.Type {
278+ Type : & Ydb.Type {
279279 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_TIMESTAMP },
280280 },
281- value : & Ydb.Value {
281+ Value : & Ydb.Value {
282282 Value : & Ydb.Value_Uint64Value {
283283 Uint64Value : 123456789000000 ,
284284 },
@@ -290,15 +290,15 @@ func TestBuilder(t *testing.T) {
290290 args : []any {[... ]byte {1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , 1 , 2 , 3 , 4 , 5 , 6 }, uint32 (22 ), uint32 (9 )},
291291
292292 expected : expected {
293- kind : & Ydb.Type {
293+ Type : & Ydb.Type {
294294 Type : & Ydb.Type_DecimalType {
295295 DecimalType : & Ydb.DecimalType {
296296 Precision : 22 ,
297297 Scale : 9 ,
298298 },
299299 },
300300 },
301- value : & Ydb.Value {
301+ Value : & Ydb.Value {
302302 High_128 : 72623859790382856 ,
303303 Value : & Ydb.Value_Low_128 {
304304 Low_128 : 648519454493508870 ,
@@ -311,10 +311,10 @@ func TestBuilder(t *testing.T) {
311311 args : []any {`{"a": 1,"b": "B"}` },
312312
313313 expected : expected {
314- kind : & Ydb.Type {
314+ Type : & Ydb.Type {
315315 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_JSON },
316316 },
317- value : & Ydb.Value {
317+ Value : & Ydb.Value {
318318 Value : & Ydb.Value_TextValue {
319319 TextValue : `{"a": 1,"b": "B"}` ,
320320 },
@@ -326,10 +326,10 @@ func TestBuilder(t *testing.T) {
326326 args : []any {`{"a": 1,"b": "B"}` },
327327
328328 expected : expected {
329- kind : & Ydb.Type {
329+ Type : & Ydb.Type {
330330 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_JSON_DOCUMENT },
331331 },
332- value : & Ydb.Value {
332+ Value : & Ydb.Value {
333333 Value : & Ydb.Value_TextValue {
334334 TextValue : `{"a": 1,"b": "B"}` ,
335335 },
@@ -341,10 +341,10 @@ func TestBuilder(t *testing.T) {
341341 args : []any {[]byte (`{"a": 1,"b": "B"}` )},
342342
343343 expected : expected {
344- kind : & Ydb.Type {
344+ Type : & Ydb.Type {
345345 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_YSON },
346346 },
347- value : & Ydb.Value {
347+ Value : & Ydb.Value {
348348 Value : & Ydb.Value_BytesValue {
349349 BytesValue : []byte (`{"a": 1,"b": "B"}` ),
350350 },
@@ -356,10 +356,10 @@ func TestBuilder(t *testing.T) {
356356 args : []any {[... ]byte {1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 }},
357357
358358 expected : expected {
359- kind : & Ydb.Type {
359+ Type : & Ydb.Type {
360360 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_UUID },
361361 },
362- value : & Ydb.Value {
362+ Value : & Ydb.Value {
363363 Value : & Ydb.Value_Low_128 {
364364 Low_128 : 651345242494996240 ,
365365 },
@@ -372,10 +372,10 @@ func TestBuilder(t *testing.T) {
372372 args : []any {time .Unix (123456789 , 456 ).UTC ()},
373373
374374 expected : expected {
375- kind : & Ydb.Type {
375+ Type : & Ydb.Type {
376376 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_TZ_DATETIME },
377377 },
378- value : & Ydb.Value {
378+ Value : & Ydb.Value {
379379 Value : & Ydb.Value_TextValue {
380380 TextValue : "1973-11-29T21:33:09Z" ,
381381 },
@@ -387,10 +387,10 @@ func TestBuilder(t *testing.T) {
387387 args : []any {time .Unix (123456789 , 456 ).UTC ()},
388388
389389 expected : expected {
390- kind : & Ydb.Type {
390+ Type : & Ydb.Type {
391391 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_TZ_DATE },
392392 },
393- value : & Ydb.Value {
393+ Value : & Ydb.Value {
394394 Value : & Ydb.Value_TextValue {
395395 TextValue : "1973-11-29" ,
396396 },
@@ -402,10 +402,10 @@ func TestBuilder(t *testing.T) {
402402 args : []any {time .Unix (123456789 , 456 ).UTC ()},
403403
404404 expected : expected {
405- kind : & Ydb.Type {
405+ Type : & Ydb.Type {
406406 Type : & Ydb.Type_TypeId {TypeId : Ydb .Type_TZ_TIMESTAMP },
407407 },
408- value : & Ydb.Value {
408+ Value : & Ydb.Value {
409409 Value : & Ydb.Value_TextValue {
410410 TextValue : "1973-11-29T21:33:09.000000Z" ,
411411 },
@@ -426,14 +426,14 @@ func TestBuilder(t *testing.T) {
426426
427427 params := result .Build ().ToYDB (a )
428428
429- require .Equal (t ,
429+ require .Equal (t ,
430430 paramsToJSON (
431- map [string ]* Ydb.TypedValue {
432- "$x" : {
433- Type : tc .expected .kind ,
434- Value : tc .expected .value ,
435- },
436- }),
431+ map [string ]* Ydb.TypedValue {
432+ "$x" : {
433+ Type : tc .expected .Type ,
434+ Value : tc .expected .Value ,
435+ },
436+ }),
437437 paramsToJSON (params ),
438438 )
439439 })
0 commit comments