diff options
Diffstat (limited to 'vendor/github.com/slack-go/slack/webhooks_go113.go')
-rw-r--r-- | vendor/github.com/slack-go/slack/webhooks_go113.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vendor/github.com/slack-go/slack/webhooks_go113.go b/vendor/github.com/slack-go/slack/webhooks_go113.go index 99c243f5..021eac01 100644 --- a/vendor/github.com/slack-go/slack/webhooks_go113.go +++ b/vendor/github.com/slack-go/slack/webhooks_go113.go @@ -1,3 +1,4 @@ +//go:build go1.13 // +build go1.13 package slack @@ -6,26 +7,25 @@ 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: %w", err) } req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(raw)) if err != nil { - return errors.Wrap(err, "failed new request") + return fmt.Errorf("failed new request: %w", err) } 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: %w", err) } defer resp.Body.Close() |