mirror of
https://github.com/cowardmrx/rds_cache_go.git
synced 2025-01-19 03:05:56 +08:00
'updateoptionWithFunc'
This commit is contained in:
parent
f14dba1b2c
commit
b42d88f929
2
cache.go
2
cache.go
@ -34,7 +34,7 @@ func WithPassword(password string) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WithDbname(db int) Option {
|
func WithDB(db int) Option {
|
||||||
return func(ca *config) {
|
return func(ca *config) {
|
||||||
ca.DB = db
|
ca.DB = db
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var caches = NewCache(WithHost("192.168.0.151"), WithPort("6379"), WithDbname(13))
|
var caches = NewCache(WithHost("192.168.0.151"), WithPort("6379"), WithDB(13))
|
||||||
|
|
||||||
func TestCache(t *testing.T) {
|
func TestCache(t *testing.T) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user