debug
This commit is contained in:
parent
f2509f0ca6
commit
55d1c2330d
24
config.go
24
config.go
@ -42,6 +42,10 @@ func (c *Config) Load() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if *debugFlag {
|
||||
log.Printf("Config.Load :\r\n%v", cfg)
|
||||
}
|
||||
|
||||
l, err := time.LoadLocation(cfg.Timezone)
|
||||
if err != nil {
|
||||
if *debugFlag {
|
||||
@ -50,11 +54,25 @@ func (c *Config) Load() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(cfg.Email.smtpHost) == 0 || len(cfg.Email.fromEmail) == 0 || len(cfg.Email.toEmail) == 0 {
|
||||
if len(cfg.Email.smtpHost) == 0 {
|
||||
if *debugFlag {
|
||||
log.Printf("Config.Load : no email")
|
||||
log.Printf("Config.Load : no smtp")
|
||||
}
|
||||
return fmt.Errorf("no email")
|
||||
return fmt.Errorf("no smtp")
|
||||
}
|
||||
|
||||
if len(cfg.Email.fromEmail) == 0 {
|
||||
if *debugFlag {
|
||||
log.Printf("Config.Load : no email from")
|
||||
}
|
||||
return fmt.Errorf("no email from")
|
||||
}
|
||||
|
||||
if len(cfg.Email.toEmail) == 0 {
|
||||
if *debugFlag {
|
||||
log.Printf("Config.Load : no email to")
|
||||
}
|
||||
return fmt.Errorf("no email to")
|
||||
}
|
||||
|
||||
c.Now = time.Now().In(l)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||
package main
|
||||
var githash = "a5b2d51"
|
||||
var buildstamp = "2022-06-19_04:26:58"
|
||||
var commits = "47"
|
||||
var version = "a5b2d51-b47 - 2022-06-19_04:26:58"
|
||||
var githash = "f2509f0"
|
||||
var buildstamp = "2022-06-19_04:31:26"
|
||||
var commits = "48"
|
||||
var version = "f2509f0-b48 - 2022-06-19_04:31:26"
|
||||
|
Loading…
Reference in New Issue
Block a user