'updateoptionWithFunc'

This commit is contained in:
coward 2021-12-06 16:09:12 +08:00
parent f14dba1b2c
commit b42d88f929
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ func WithPassword(password string) Option {
}
}
func WithDbname(db int) Option {
func WithDB(db int) Option {
return func(ca *config) {
ca.DB = db
}

View File

@ -6,7 +6,7 @@ import (
"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) {