diff --git a/conf/var.go b/conf/var.go index a1d72440..79bd71e8 100644 --- a/conf/var.go +++ b/conf/var.go @@ -39,7 +39,7 @@ var ( ImageTypes = []string{"jpg", "tiff", "jpeg", "png", "gif", "bmp", "svg", "ico", "swf", "webp"} ) -var settingsMap = make(map[string]string, 0) +var settingsMap = make(map[string]string) func Set(key string, value string) { settingsMap[key] = value diff --git a/drivers/189/189.go b/drivers/189/189.go index c1fc2cbe..68caaebb 100644 --- a/drivers/189/189.go +++ b/drivers/189/189.go @@ -26,7 +26,7 @@ import ( ) var client189Map map[string]*resty.Client -var infoMap = make(map[string]Rsa, 0) +var infoMap = make(map[string]Rsa) func (driver Cloud189) getClient(account *model.Account) (*resty.Client, error) { client, ok := client189Map[account.Name] diff --git a/drivers/189/util.go b/drivers/189/util.go index 8f910a25..c8732cff 100644 --- a/drivers/189/util.go +++ b/drivers/189/util.go @@ -156,7 +156,7 @@ func getMd5(data []byte) []byte { func init() { base.RegisterDriver(&Cloud189{}) - client189Map = make(map[string]*resty.Client, 0) + client189Map = make(map[string]*resty.Client) } func decodeURIComponent(str string) string { diff --git a/drivers/base/driver.go b/drivers/base/driver.go index d5b7e4b4..0c5c7ad1 100644 --- a/drivers/base/driver.go +++ b/drivers/base/driver.go @@ -84,7 +84,7 @@ func GetDriversMap() map[string]Driver { } func GetDrivers() map[string][]Item { - res := make(map[string][]Item, 0) + res := make(map[string][]Item) for k, v := range driversMap { if v.Config().OnlyProxy { res[k] = v.Items() diff --git a/drivers/ftp/ftp.go b/drivers/ftp/ftp.go index d0a2c4e3..f41f99a9 100644 --- a/drivers/ftp/ftp.go +++ b/drivers/ftp/ftp.go @@ -27,4 +27,5 @@ func (driver FTP) Login(account *model.Account) (*ftp.ServerConn, error) { func init() { base.RegisterDriver(&FTP{}) + connMap = make(map[string]*ftp.ServerConn) } diff --git a/drivers/s3/s3.go b/drivers/s3/s3.go index 05606d55..d0989d6b 100644 --- a/drivers/s3/s3.go +++ b/drivers/s3/s3.go @@ -118,6 +118,6 @@ func (driver S3) GetKey(path string, account *model.Account, dir bool) string { } func init() { - sessionsMap = make(map[string]*session.Session, 0) + sessionsMap = make(map[string]*session.Session) base.RegisterDriver(&S3{}) }