simplify
This commit is contained in:
20
config.go
20
config.go
@@ -17,15 +17,15 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
ScheduleDuration map[string]string `json:"schedule"`
|
||||
Box map[string]BoxConfig `json:"box"`
|
||||
Email EmailConfig `json:"email"`
|
||||
Apps []AppConfig `json:"apps"`
|
||||
Timezone string `json:"timezone"`
|
||||
Admin *AdminConfig `json:"admin"`
|
||||
box map[string]*Box `json:"-"`
|
||||
apps map[string]*App `json:"-"`
|
||||
timezone *time.Location `json:"-"`
|
||||
ScheduleDuration map[string]string `json:"schedule"`
|
||||
Box map[string]*BoxConfig `json:"box"`
|
||||
Email *EmailConfig `json:"email,omitempty"`
|
||||
Apps []*AppConfig `json:"apps"`
|
||||
Timezone string `json:"timezone"`
|
||||
Admin *AdminConfig `json:"admin"`
|
||||
box map[string]*Box `json:"-"`
|
||||
apps map[string]*App `json:"-"`
|
||||
timezone *time.Location `json:"-"`
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -95,7 +95,7 @@ func LoadConfigByte(conf []byte) (*Config, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if c.Email.Active {
|
||||
if c.Email != nil {
|
||||
if len(c.Email.SmtpHost) == 0 {
|
||||
err := fmt.Errorf("no smtp")
|
||||
log.WithFields(log.Fields{"error": err}).Errorf("")
|
||||
|
||||
Reference in New Issue
Block a user