Improve: config convergent and add log-level

This commit is contained in:
Dreamacro
2018-07-26 00:04:59 +08:00
parent 7357d2d0c2
commit 8389150318
31 changed files with 757 additions and 484 deletions

View File

@ -11,7 +11,6 @@ import (
"strings"
log "github.com/sirupsen/logrus"
"gopkg.in/ini.v1"
)
const (
@ -107,13 +106,3 @@ func downloadMMDB(path string) (err error) {
return nil
}
func GetConfig() (*ini.File, error) {
if _, err := os.Stat(ConfigPath); os.IsNotExist(err) {
return nil, err
}
return ini.LoadSources(
ini.LoadOptions{AllowBooleanKeys: true},
ConfigPath,
)
}