diff options
| author | Shulhan <ms@kilabit.info> | 2022-04-06 01:40:07 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-04-06 02:37:22 +0700 |
| commit | 429a9d9205bad2be34cdfe7fb5b1a9a6f127f541 (patch) | |
| tree | 1debf749d60e00a5ac03a3fecc6960aead0ad236 /api | |
| parent | 7186de3415b130a6c67388d8f1bcf54404f6202b (diff) | |
| download | pakakeh.go-429a9d9205bad2be34cdfe7fb5b1a9a6f127f541.tar.xz | |
all: replace any usage of ioutil package with os or io
Since Go 1.16, the ioutil package has been deprecated.
This changes replace any usage that use functions from ioutil package
with their replacement from package os or package io.
Diffstat (limited to 'api')
| -rw-r--r-- | api/slack/slack.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/slack/slack.go b/api/slack/slack.go index 360a43db..c5546c61 100644 --- a/api/slack/slack.go +++ b/api/slack/slack.go @@ -12,7 +12,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" ) @@ -32,7 +32,7 @@ func PostWebhook(webhookUrl string, msg *Message) (err error) { } if res.StatusCode != http.StatusOK { - resBody, err := ioutil.ReadAll(res.Body) + resBody, err := io.ReadAll(res.Body) if err != nil { return fmt.Errorf("PostWebhook: %w", err) } |
