diff options
Diffstat (limited to 'vendor/github.com/slack-go/slack/webhooks_go112.go')
-rw-r--r-- | vendor/github.com/slack-go/slack/webhooks_go112.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vendor/github.com/slack-go/slack/webhooks_go112.go b/vendor/github.com/slack-go/slack/webhooks_go112.go index 4e0db0e4..0eb539ac 100644 --- a/vendor/github.com/slack-go/slack/webhooks_go112.go +++ b/vendor/github.com/slack-go/slack/webhooks_go112.go @@ -1,3 +1,4 @@ +//go:build !go1.13 // +build !go1.13 package slack @@ -6,27 +7,26 @@ import ( "bytes" "context" "encoding/json" + "fmt" "net/http" - - "github.com/pkg/errors" ) func PostWebhookCustomHTTPContext(ctx context.Context, url string, httpClient *http.Client, msg *WebhookMessage) error { raw, err := json.Marshal(msg) if err != nil { - return errors.Wrap(err, "marshal failed") + return fmt.Errorf("marshal failed: %v", err) } req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(raw)) if err != nil { - return errors.Wrap(err, "failed new request") + return fmt.Errorf("failed new request: %v", err) } req = req.WithContext(ctx) req.Header.Set("Content-Type", "application/json") resp, err := httpClient.Do(req) if err != nil { - return errors.Wrap(err, "failed to post webhook") + return fmt.Errorf("failed to post webhook: %v", err) } defer resp.Body.Close() |