()
| 22 | } |
| 23 | |
| 24 | func (c EmailConfig) Check() error { |
| 25 | if c.Username == "" { |
| 26 | return fmt.Errorf("email username is empty") |
| 27 | } |
| 28 | if c.Password == "" { |
| 29 | return fmt.Errorf("email password is empty") |
| 30 | } |
| 31 | if c.Host == "" { |
| 32 | return fmt.Errorf("email host is empty") |
| 33 | } |
| 34 | if c.Port == 0 { |
| 35 | return fmt.Errorf("email port is empty") |
| 36 | } |
| 37 | if c.To == "" { |
| 38 | return fmt.Errorf("email to is empty") |
| 39 | } |
| 40 | if c.From == "" { |
| 41 | return fmt.Errorf("email from is empty") |
| 42 | } |
| 43 | return nil |
| 44 | } |
| 45 | |
| 46 | func (c EmailConfig) String() string { |
| 47 | return fmt.Sprintf( |
no outgoing calls
no test coverage detected