Skip to content

Commit

Permalink
🐛 fix connMap not init
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jan 29, 2022
1 parent f26ac57 commit 6fd05d7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conf/var.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/189/189.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion drivers/189/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion drivers/base/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions drivers/ftp/ftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion drivers/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
}

0 comments on commit 6fd05d7

Please sign in to comment.