Update of nlopes/slack dependency (#511)

This commit is contained in:
Duco van Amstel
2018-10-07 22:17:46 +01:00
committed by Wim
parent 69646a160d
commit 917040b044
23 changed files with 992 additions and 92 deletions

View File

@@ -1,15 +1,16 @@
package slack
import (
"github.com/pkg/errors"
"net/http"
"bytes"
"encoding/json"
"net/http"
"github.com/pkg/errors"
)
type WebhookMessage struct {
Text string `json:"text,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
Text string `json:"text,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
}
func PostWebhook(url string, msg *WebhookMessage) error {
@@ -19,7 +20,7 @@ func PostWebhook(url string, msg *WebhookMessage) error {
return errors.Wrap(err, "marshal failed")
}
response, err := http.Post(url, "application/json", bytes.NewReader(raw));
response, err := http.Post(url, "application/json", bytes.NewReader(raw))
if err != nil {
return errors.Wrap(err, "failed to post webhook")