Skip to content

Commit 9b6ee9c

Browse files
committed
chore: gofmt all code
1 parent 11c4d6f commit 9b6ee9c

34 files changed

+72
-55
lines changed

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ testdata/redis:
1919
testdata/redis/src/redis-server: testdata/redis
2020
cd $< && make all
2121

22-
tag:
23-
git tag $(VERSION)
24-
git tag extra/rediscmd/$(VERSION)
25-
git tag extra/redisotel/$(VERSION)
26-
git tag extra/rediscensus/$(VERSION)
22+
fmt:
23+
gofmt -w -s ./
24+
goimports -w -local github.com/go-redis/redis ./

cluster_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"sync"
1010
"time"
1111

12-
"github.com/go-redis/redis/v8"
13-
"github.com/go-redis/redis/v8/internal/hashtag"
14-
1512
. "github.com/onsi/ginkgo"
1613
. "github.com/onsi/gomega"
14+
15+
"github.com/go-redis/redis/v8"
16+
"github.com/go-redis/redis/v8/internal/hashtag"
1717
)
1818

1919
type clusterScenario struct {

command_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"errors"
55
"time"
66

7-
redis "github.com/go-redis/redis/v8"
8-
97
. "github.com/onsi/ginkgo"
108
. "github.com/onsi/gomega"
9+
10+
redis "github.com/go-redis/redis/v8"
1111
)
1212

1313
var _ = Describe("Cmd", func() {
@@ -72,7 +72,7 @@ var _ = Describe("Cmd", func() {
7272
})
7373

7474
It("supports time.Time", func() {
75-
tm := time.Date(2019, 01, 01, 9, 45, 10, 222125, time.UTC)
75+
tm := time.Date(2019, 1, 1, 9, 45, 10, 222125, time.UTC)
7676

7777
err := client.Set(ctx, "time_key", tm, 0).Err()
7878
Expect(err).NotTo(HaveOccurred())

commands_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,11 @@ var _ = Describe("Commands", func() {
472472
idleTime := client.ObjectIdleTime(ctx, "key")
473473
Expect(idleTime.Err()).NotTo(HaveOccurred())
474474

475-
//Redis returned milliseconds/1000, which may cause ObjectIdleTime to be at a critical value,
476-
//should be +1s to deal with the critical value problem.
477-
//if too much time (>1s) is used during command execution, it may also cause the test to fail.
478-
//so the ObjectIdleTime result should be <=now-start+1s
479-
//link: https://github.com/redis/redis/blob/5b48d900498c85bbf4772c1d466c214439888115/src/object.c#L1265-L1272
475+
// Redis returned milliseconds/1000, which may cause ObjectIdleTime to be at a critical value,
476+
// should be +1s to deal with the critical value problem.
477+
// if too much time (>1s) is used during command execution, it may also cause the test to fail.
478+
// so the ObjectIdleTime result should be <=now-start+1s
479+
// link: https://github.com/redis/redis/blob/5b48d900498c85bbf4772c1d466c214439888115/src/object.c#L1265-L1272
480480
Expect(idleTime.Val()).To(BeNumerically("<=", time.Now().Sub(start)+time.Second))
481481
})
482482

example/otel/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import (
44
"context"
55
"sync"
66

7-
"github.com/go-redis/redis/extra/redisotel/v8"
8-
"github.com/go-redis/redis/v8"
97
"go.opentelemetry.io/otel"
108
"go.opentelemetry.io/otel/codes"
119
"go.opentelemetry.io/otel/exporters/stdout/stdouttrace"
1210
sdktrace "go.opentelemetry.io/otel/sdk/trace"
11+
12+
"github.com/go-redis/redis/extra/redisotel/v8"
13+
"github.com/go-redis/redis/v8"
1314
)
1415

1516
var tracer = otel.Tracer("redisexample")

example/scan-struct/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55

66
"github.com/davecgh/go-spew/spew"
7+
78
"github.com/go-redis/redis/v8"
89
)
910

extra/rediscensus/rediscensus.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package rediscensus
33
import (
44
"context"
55

6+
"go.opencensus.io/trace"
7+
68
"github.com/go-redis/redis/extra/rediscmd/v8"
79
"github.com/go-redis/redis/v8"
8-
"go.opencensus.io/trace"
910
)
1011

1112
type TracingHook struct{}

extra/rediscmd/safe.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build appengine
12
// +build appengine
23

34
package rediscmd

extra/rediscmd/unsafe.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !appengine
12
// +build !appengine
23

34
package rediscmd

extra/redisotel/redisotel.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package redisotel
33
import (
44
"context"
55

6-
"github.com/go-redis/redis/extra/rediscmd/v8"
7-
"github.com/go-redis/redis/v8"
86
"go.opentelemetry.io/otel"
97
"go.opentelemetry.io/otel/attribute"
108
"go.opentelemetry.io/otel/codes"
119
"go.opentelemetry.io/otel/trace"
10+
11+
"github.com/go-redis/redis/extra/rediscmd/v8"
12+
"github.com/go-redis/redis/v8"
1213
)
1314

1415
var tracer = otel.Tracer("github.com/go-redis/redis")

0 commit comments

Comments
 (0)