Skip to content

Commit 953a1ed

Browse files
DOC-5472 fixed param formatting, following feedback
1 parent d511984 commit 953a1ed

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

doctests/timeseries_tut_test.go

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ func ExampleClient_timeseries_create() {
5757
res4, err := rdb.TSAddWithArgs(
5858
ctx,
5959
"thermometer:2",
60-
1, 10.8,
60+
1,
61+
10.8,
6162
&redis.TSOptions{
6263
Retention: 100,
6364
},
@@ -80,7 +81,8 @@ func ExampleClient_timeseries_create() {
8081
res6, err := rdb.TSAddWithArgs(
8182
ctx,
8283
"thermometer:3",
83-
1, 10.4,
84+
1,
85+
10.4,
8486
&redis.TSOptions{
8587
Labels: map[string]string{
8688
"location": "UK",
@@ -200,9 +202,7 @@ func ExampleClient_timeseries_range() {
200202
// Retrieve all the data points in ascending order.
201203
// Note: use 0 and `math.MaxInt64` instead of - and +
202204
// to denote the minimum and maximum possible timestamps.
203-
res3, err := rdb.TSRange(ctx, "rg:1",
204-
0, math.MaxInt64,
205-
).Result()
205+
res3, err := rdb.TSRange(ctx, "rg:1", 0, math.MaxInt64).Result()
206206
if err != nil {
207207
panic(err)
208208
}
@@ -252,7 +252,8 @@ func ExampleClient_timeseries_range() {
252252
res8, err := rdb.TSRangeWithArgs(
253253
ctx,
254254
"rg:1",
255-
0, math.MaxInt64,
255+
0,
256+
math.MaxInt64,
256257
&redis.TSRangeOptions{
257258
FilterByTS: []int{0, 2, 4},
258259
},
@@ -266,7 +267,8 @@ func ExampleClient_timeseries_range() {
266267
res9, err := rdb.TSRevRangeWithArgs(
267268
ctx,
268269
"rg:1",
269-
0, math.MaxInt64,
270+
0,
271+
math.MaxInt64,
270272
&redis.TSRevRangeOptions{
271273
FilterByTS: []int{0, 2, 4},
272274
FilterByValue: []int{20, 25},
@@ -281,7 +283,8 @@ func ExampleClient_timeseries_range() {
281283
res10, err := rdb.TSRevRangeWithArgs(
282284
ctx,
283285
"rg:1",
284-
0, math.MaxInt64,
286+
0,
287+
math.MaxInt64,
285288
&redis.TSRevRangeOptions{
286289
FilterByTS: []int{0, 2, 4},
287290
FilterByValue: []int{22, 22},
@@ -491,7 +494,8 @@ func ExampleClient_timeseries_query_multi() {
491494
// specify any aggregators.
492495
res30, err := rdb.TSMRangeWithArgs(
493496
ctx,
494-
0, 2,
497+
0,
498+
2,
495499
[]string{"unit=mm"},
496500
&redis.TSMRangeOptions{
497501
WithLabels: true,
@@ -535,7 +539,8 @@ func ExampleClient_timeseries_query_multi() {
535539
// in descending order of timestamp.
536540
res31, err := rdb.TSMRevRangeWithArgs(
537541
ctx,
538-
1, 3,
542+
1,
543+
3,
539544
[]string{"unit=(cm,mm)"},
540545
&redis.TSMRevRangeOptions{
541546
SelectedLabels: []interface{}{"location"},
@@ -649,7 +654,8 @@ func ExampleClient_timeseries_aggregation() {
649654
res32, err := rdb.TSRangeWithArgs(
650655
ctx,
651656
"rg:2",
652-
0, math.MaxInt64,
657+
0,
658+
math.MaxInt64,
653659
&redis.TSRangeOptions{
654660
Aggregator: redis.Avg,
655661
BucketDuration: 2,
@@ -707,7 +713,8 @@ func ExampleClient_timeseries_agg_bucket() {
707713
res3, err := rdb.TSRangeWithArgs(
708714
ctx,
709715
"sensor3",
710-
10, 70,
716+
10,
717+
70,
711718
&redis.TSRangeOptions{
712719
Aggregator: redis.Min,
713720
BucketDuration: 25,
@@ -724,7 +731,8 @@ func ExampleClient_timeseries_agg_bucket() {
724731
res4, err := rdb.TSRangeWithArgs(
725732
ctx,
726733
"sensor3",
727-
10, 70,
734+
10,
735+
70,
728736
&redis.TSRangeOptions{
729737
Aggregator: redis.Min,
730738
BucketDuration: 25,
@@ -837,7 +845,8 @@ func ExampleClient_timeseries_aggmulti() {
837845
// for the country at that timestamp.
838846
res44, err := rdb.TSMRangeWithArgs(
839847
ctx,
840-
0, math.MaxInt64,
848+
0,
849+
math.MaxInt64,
841850
[]string{"country=(us,uk)"},
842851
&redis.TSMRangeOptions{
843852
GroupByLabel: "country",
@@ -884,7 +893,8 @@ func ExampleClient_timeseries_aggmulti() {
884893
// for the country at that timestamp.
885894
res45, err := rdb.TSMRangeWithArgs(
886895
ctx,
887-
0, math.MaxInt64,
896+
0,
897+
math.MaxInt64,
888898
[]string{"country=(us,uk)"},
889899
&redis.TSMRangeOptions{
890900
GroupByLabel: "country",

0 commit comments

Comments
 (0)