pkg/api: Check errors (#19657)

* pkg/api: Check errors
* pkg/api: Remove unused function HashEmail
This commit is contained in:
Arve Knudsen
2019-10-08 18:57:53 +02:00
committed by GitHub
parent dabc848e11
commit 0a2d5e16dd
12 changed files with 86 additions and 45 deletions
+4 -1
View File
@@ -7,6 +7,7 @@ import (
"strings"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/infra/log"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
)
@@ -61,7 +62,9 @@ func GetGravatarUrl(text string) string {
}
hasher := md5.New()
hasher.Write([]byte(strings.ToLower(text)))
if _, err := hasher.Write([]byte(strings.ToLower(text))); err != nil {
log.Warn("Failed to hash text: %s", err)
}
return fmt.Sprintf(setting.AppSubUrl+"/avatar/%x", hasher.Sum(nil))
}