Explorar o código

fix: fixed gometalinter issues with Discord PR

Torkel Ödegaard %!s(int64=7) %!d(string=hai) anos
pai
achega
4c6e4e2aa6
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      pkg/services/alerting/notifiers/discord.go

+ 4 - 2
pkg/services/alerting/notifiers/discord.go

@@ -91,8 +91,7 @@ func (this *DiscordNotifier) Notify(evalContext *alerting.EvalContext) error {
 	embed.Set("fields", fields)
 	embed.Set("footer", footer)
 
-	var image = make(map[string]interface{})
-
+	var image map[string]interface{}
 	var embeddedImage = false
 
 	if evalContext.ImagePublicUrl != "" {
@@ -141,6 +140,9 @@ func (this *DiscordNotifier) Notify(evalContext *alerting.EvalContext) error {
 		}
 
 		fw, err = w.CreateFormFile("file", "graph.png")
+		if err != nil {
+			return err
+		}
 
 		if _, err = io.Copy(fw, f); err != nil {
 			return err