style: update some code to fit go 1.19

This commit is contained in:
Li4n0
2022-09-14 01:05:24 +08:00
parent 4cd232f7e0
commit fe316220a1
8 changed files with 514 additions and 643 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ package notice
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"
@@ -66,7 +66,7 @@ func (d *DingTalk) notice(r record.Record) error {
defer resp.Body.Close()
if resp.StatusCode/100 != 2 {
data, err := ioutil.ReadAll(resp.Body)
data, err := io.ReadAll(resp.Body)
if err != nil {
return errors.Wrap(err, "read HTTP response body")
}