mirror of
https://github.com/distribution/distribution.git
synced 2025-09-12 21:28:59 +00:00
Fix gometalint errors
Signed-off-by: Manish Tomar <manish.tomar@docker.com> Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
@@ -20,7 +20,7 @@ type logHook struct {
|
||||
func (hook *logHook) Fire(entry *logrus.Entry) error {
|
||||
addr := strings.Split(hook.Mail.Addr, ":")
|
||||
if len(addr) != 2 {
|
||||
return errors.New("Invalid Mail Address")
|
||||
return errors.New("invalid Mail Address")
|
||||
}
|
||||
host := addr[0]
|
||||
subject := fmt.Sprintf("[%s] %s: %s", entry.Level, host, entry.Message)
|
||||
@@ -37,7 +37,7 @@ func (hook *logHook) Fire(entry *logrus.Entry) error {
|
||||
if err := t.Execute(b, entry); err != nil {
|
||||
return err
|
||||
}
|
||||
body := fmt.Sprintf("%s", b)
|
||||
body := b.String()
|
||||
|
||||
return hook.Mail.sendMail(subject, body)
|
||||
}
|
||||
|
Reference in New Issue
Block a user