@@ -18,19 +18,20 @@ func TestEncodeValues(t *testing.T) {
18
18
t .Cleanup (func () { time .Local = loc })
19
19
20
20
in := & complex.Complex {
21
- Id : 2233 ,
22
- NoOne : "2233" ,
23
- Simple : & complex.Simple {Component : "5566" },
24
- Simples : []string {"3344" , "5566" },
25
- B : true ,
26
- Sex : complex .Sex_woman ,
27
- Age : 18 ,
28
- A : 19 ,
29
- Count : 3 ,
30
- Price : 11.23 ,
31
- D : 22.22 ,
32
- Byte : []byte ("123" ),
33
- Map : map [string ]string {"kratos" : "https://go-kratos.dev/" , "kratos_start" : "https://go-kratos.dev/en/docs/getting-started/start/" },
21
+ Id : 2233 ,
22
+ NoOne : "2233" ,
23
+ Simple : & complex.Simple {Component : "5566" },
24
+ Simples : []string {"3344" , "5566" },
25
+ B : true ,
26
+ Sex : complex .Sex_woman ,
27
+ Age : 18 ,
28
+ A : 19 ,
29
+ Count : 3 ,
30
+ Price : 11.23 ,
31
+ D : 22.22 ,
32
+ Byte : []byte ("123" ),
33
+ Map : map [string ]string {"kratos" : "https://go-kratos.dev/" , "kratos_start" : "https://go-kratos.dev/en/docs/getting-started/start/" },
34
+ MapInt64Key : map [int64 ]string {1 : "kratos" , 2 : "go-zero" },
34
35
35
36
Timestamp : & timestamppb.Timestamp {Seconds : 20 , Nanos : 2 },
36
37
Duration : & durationpb.Duration {Seconds : 120 , Nanos : 22 },
@@ -49,9 +50,9 @@ func TestEncodeValues(t *testing.T) {
49
50
if err != nil {
50
51
t .Fatal (err )
51
52
}
52
- want := "a=19&age=18&b=true&bool=false&byte=MTIz&bytes=MTIz&count=3&d=22.22&double=12.33&duration=2m0.000000022s&field=1%2C2&float=12.34&id=2233&int32=32&int64=64&map%5Bkratos%5D=https%3A%2F%2Fgo-kratos.dev%2F&map%5Bkratos_start%5D=https%3A%2F%2Fgo-kratos.dev%2Fen%2Fdocs%2Fgetting-started%2Fstart%2F&numberOne=2233&price=11.23&sex=woman&simples=3344&simples=5566&string=go-kratos×tamp=1970-01-01T00%3A00%3A20.000000002Z&uint32=32&uint64=64&very_simple.component=5566" // nolint:lll
53
+ want := "a=19&age=18&b=true&bool=false&byte=MTIz&bytes=MTIz&count=3&d=22.22&double=12.33&duration=2m0.000000022s&field=1%2C2&float=12.34&id=2233&int32=32&int64=64&map%5Bkratos%5D=https%3A%2F%2Fgo-kratos.dev%2F&map%5Bkratos_start%5D=https%3A%2F%2Fgo-kratos.dev%2Fen%2Fdocs%2Fgetting-started%2Fstart%2F&map_int64_key%5B1%5D=kratos&map_int64_key%5B2%5D=go-zero& numberOne=2233&price=11.23&sex=woman&simples=3344&simples=5566&string=go-kratos×tamp=1970-01-01T00%3A00%3A20.000000002Z&uint32=32&uint64=64&very_simple.component=5566" // nolint:lll
53
54
if got := query .Encode (); want != got {
54
- t .Errorf ("want : %s, got : %s" , want , got )
55
+ t .Errorf ("\n want : %s, \n got : %s" , want , got )
55
56
}
56
57
}
57
58
0 commit comments