mongo.go重构
This commit is contained in:
@@ -29,9 +29,13 @@ type MongoDB struct {
|
||||
Cache bool
|
||||
}
|
||||
|
||||
func DB(cache bool) *MongoDB {
|
||||
func DB(cache ...bool) *MongoDB {
|
||||
b := true
|
||||
if len(cache) > 0 {
|
||||
b = cache[0]
|
||||
}
|
||||
return &MongoDB{
|
||||
Cache: cache,
|
||||
Cache: b,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user