From f33dc4d8669e0e5e2deb7c4779ac931d0d15a1f5 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Mon, 17 Jun 2019 12:28:01 +0000 Subject: [PATCH] [skip ci] gofmt --- alertmanager-gotify.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/alertmanager-gotify.go b/alertmanager-gotify.go index 19c3858..88bedd1 100644 --- a/alertmanager-gotify.go +++ b/alertmanager-gotify.go @@ -1,12 +1,12 @@ package main import ( + "encoding/json" + "io/ioutil" "log" "net/http" "net/url" "os" - "encoding/json" - "io/ioutil" "strings" "github.com/gotify/go-api-client/auth" @@ -21,13 +21,13 @@ type POSTData struct { type Alert struct { Annotations Annotations `json:annotations` - Labels Labels `json:labels` - Status string `json:status` + Labels Labels `json:labels` + Status string `json:status` } type Annotations struct { Description string `json:description` - Title string `json:title` + Title string `json:title` } type Labels struct { @@ -37,7 +37,7 @@ type Labels struct { func main() { gotifyURL := os.Getenv("GOTIFY_URL") - http.HandleFunc("/alert", func (w http.ResponseWriter, r *http.Request) { + http.HandleFunc("/alert", func(w http.ResponseWriter, r *http.Request) { if r.Method != "POST" { http.Error(w, "405 Method not allowed", http.StatusMethodNotAllowed) return @@ -80,8 +80,8 @@ func main() { params := message.NewCreateMessageParams() params.Body = &models.MessageExternal{ - Title: title.String(), - Message: alert.Annotations.Description, + Title: title.String(), + Message: alert.Annotations.Description, } _, err = client.Message.CreateMessage(params, auth.TokenAuth(applicationToken))