initialize plugins map

This commit is contained in:
Jinzhu 2020-06-23 10:36:45 +08:00
parent f4bfc435cc
commit 1df757113a
1 changed files with 4 additions and 0 deletions

View File

@ -87,6 +87,10 @@ func Open(dialector Dialector, config *Config) (db *DB, err error) {
config.Dialector = dialector config.Dialector = dialector
} }
if config.Plugins == nil {
config.Plugins = map[string]Plugin{}
}
if config.cacheStore == nil { if config.cacheStore == nil {
config.cacheStore = &sync.Map{} config.cacheStore = &sync.Map{}
} }