Update dependencies (#1851)

This commit is contained in:
Wim
2022-06-25 00:36:16 +02:00
committed by GitHub
parent 5604d140e3
commit 4649876956
87 changed files with 10535 additions and 4392 deletions

View File

@@ -5,6 +5,8 @@ import (
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
)
@@ -21,6 +23,7 @@ type WebhookMessage struct {
ResponseType string `json:"response_type,omitempty"`
ReplaceOriginal bool `json:"replace_original,omitempty"`
DeleteOriginal bool `json:"delete_original,omitempty"`
ReplyBroadcast bool `json:"reply_broadcast,omitempty"`
}
func PostWebhook(url string, msg *WebhookMessage) error {
@@ -51,7 +54,10 @@ func PostWebhookCustomHTTPContext(ctx context.Context, url string, httpClient *h
if err != nil {
return fmt.Errorf("failed to post webhook: %w", err)
}
defer resp.Body.Close()
defer func() {
io.Copy(ioutil.Discard, resp.Body)
resp.Body.Close()
}()
return checkStatusCode(resp, discard{})
}