Skip to content

Commit

Permalink
Merge pull request #4 from letsfire/develop
Browse files Browse the repository at this point in the history
update return value
  • Loading branch information
letsfire committed Jan 26, 2019
2 parents 9a20a2f + 1051f7f commit a8d605e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion mode/alone/alone.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ func (sam *standAloneMode) NewConn() (redis.Conn, error) {
return sam.pool.Dial()
}

func New(optFuncs ...OptFunc) mode.IMode {
var _ mode.IMode = &standAloneMode{}

func New(optFuncs ...OptFunc) *standAloneMode {
opts := options{
addr: "127.0.0.1:6379",
dialOpts: mode.DefaultDialOpts(),
Expand Down
4 changes: 3 additions & 1 deletion mode/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ func (cm *clusterMode) NewConn() (redis.Conn, error) {
return cm.rc.Dial()
}

func New(optFuncs ...OptFunc) mode.IMode {
var _ mode.IMode = &clusterMode{}

func New(optFuncs ...OptFunc) *clusterMode {
opts := options{
nodes: []string{
"127.0.0.1:30001", "127.0.0.1:30002", "127.0.0.1:30003",
Expand Down
2 changes: 1 addition & 1 deletion mode/mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mode
import (
"runtime"
"time"

"github.com/gomodule/redigo/redis"
)

Expand Down
6 changes: 4 additions & 2 deletions mode/sentinel/sentinel.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sentinel
import (
"runtime"
"time"

"github.com/FZambia/sentinel"
"github.com/gomodule/redigo/redis"
"github.com/letsfire/redigo/mode"
Expand All @@ -21,7 +21,9 @@ func (sm *sentinelMode) NewConn() (redis.Conn, error) {
return sm.pool.Dial()
}

func New(optFuncs ...OptFunc) mode.IMode {
var _ mode.IMode = &sentinelMode{}

func New(optFuncs ...OptFunc) *sentinelMode {
opts := options{
addrs: []string{"127.0.0.1:26379"},
masterName: "mymaster",
Expand Down
2 changes: 1 addition & 1 deletion redigo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sync/atomic"
"testing"
"time"

"github.com/gomodule/redigo/redis"
"github.com/letsfire/redigo/mode/alone"
"github.com/letsfire/redigo/mode/cluster"
Expand Down

0 comments on commit a8d605e

Please sign in to comment.