You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-fly/config/config.go

26 lines
436 B

package config
import (
"encoding/json"
"github.com/taoshihan1991/imaptool/tools"
"io/ioutil"
)
const Dir = "config/"
const AccountConf = Dir +"account.json"
func GetAccount()map[string]string{
var account map[string]string
isExist,_:=tools.IsFileExist(AccountConf)
if !isExist{
return account
}
info,err:=ioutil.ReadFile(AccountConf)
if err!=nil{
return account
}
err=json.Unmarshal(info,&account)
return account
}