mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Fix staticcheck issues (#28854)
* Chore: Fix issues reported by staticcheck Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Undo changes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -105,7 +105,7 @@ func (ns *NotificationService) createDialer() (*gomail.Dialer, error) {
|
||||
if ns.Cfg.Smtp.CertFile != "" {
|
||||
cert, err := tls.LoadX509KeyPair(ns.Cfg.Smtp.CertFile, ns.Cfg.Smtp.KeyFile)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Could not load cert or key file. error: %v", err)
|
||||
return nil, fmt.Errorf("could not load cert or key file: %w", err)
|
||||
}
|
||||
tlsconfig.Certificates = []tls.Certificate{cert}
|
||||
}
|
||||
@@ -159,7 +159,7 @@ func (ns *NotificationService) buildEmailMessage(cmd *models.SendEmailCommand) (
|
||||
subjectText, hasSubject := subjectData["value"]
|
||||
|
||||
if !hasSubject {
|
||||
return nil, fmt.Errorf("Missing subject in Template %s", cmd.Template)
|
||||
return nil, fmt.Errorf("missing subject in template %s", cmd.Template)
|
||||
}
|
||||
|
||||
subjectTmpl, err := template.New("subject").Parse(subjectText.(string))
|
||||
|
@@ -63,7 +63,7 @@ func (ns *NotificationService) Init() error {
|
||||
}
|
||||
|
||||
if !util.IsEmail(ns.Cfg.Smtp.FromAddress) {
|
||||
return errors.New("Invalid email address for SMTP from_address config")
|
||||
return errors.New("invalid email address for SMTP from_address config")
|
||||
}
|
||||
|
||||
if setting.EmailCodeValidMinutes == 0 {
|
||||
|
Reference in New Issue
Block a user