delete sqlite3
This commit is contained in:
@@ -46,9 +46,9 @@ type Config struct {
|
||||
|
||||
SSHExternal bool
|
||||
|
||||
HTTPProxy string `valid:"url"`
|
||||
DBPath string
|
||||
CveDBPath string
|
||||
HTTPProxy string `valid:"url"`
|
||||
JSONBaseDir string
|
||||
CveDBPath string
|
||||
|
||||
AwsProfile string
|
||||
AwsRegion string
|
||||
@@ -68,10 +68,10 @@ type Config struct {
|
||||
func (c Config) Validate() bool {
|
||||
errs := []error{}
|
||||
|
||||
if len(c.DBPath) != 0 {
|
||||
if ok, _ := valid.IsFilePath(c.DBPath); !ok {
|
||||
if len(c.JSONBaseDir) != 0 {
|
||||
if ok, _ := valid.IsFilePath(c.JSONBaseDir); !ok {
|
||||
errs = append(errs, fmt.Errorf(
|
||||
"SQLite3 DB path must be a *Absolute* file path. dbpath: %s", c.DBPath))
|
||||
"JSON base directory must be a *Absolute* file path. jsonBaseDir: %s", c.JSONBaseDir))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ func (c TOMLLoader) Load(pathToToml, keyPass string) (err error) {
|
||||
}
|
||||
|
||||
s.Host = v.Host
|
||||
if s.Host == "" {
|
||||
if len(s.Host) == 0 {
|
||||
return fmt.Errorf("%s is invalid. host is empty", name)
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ func (c TOMLLoader) Load(pathToToml, keyPass string) (err error) {
|
||||
}
|
||||
|
||||
s.KeyPath = v.KeyPath
|
||||
if s.KeyPath == "" {
|
||||
if len(s.KeyPath) == 0 {
|
||||
s.KeyPath = d.KeyPath
|
||||
}
|
||||
if s.KeyPath != "" {
|
||||
@@ -94,7 +94,7 @@ func (c TOMLLoader) Load(pathToToml, keyPass string) (err error) {
|
||||
|
||||
// s.KeyPassword = keyPass
|
||||
s.KeyPassword = v.KeyPassword
|
||||
if s.KeyPassword == "" {
|
||||
if len(s.KeyPassword) == 0 {
|
||||
s.KeyPassword = d.KeyPassword
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user