⬆️ upgrade dependencies

This commit is contained in:
naiba
2022-09-14 22:26:14 +08:00
parent 87e1b8efca
commit 1561ccb2fb
4 changed files with 37 additions and 37 deletions

View File

@@ -1,7 +1,6 @@
package model
import (
"io/ioutil"
"os"
"strconv"
"strings"
@@ -67,7 +66,7 @@ func (c *AgentConfig) Save() error {
if err != nil {
return err
}
return ioutil.WriteFile(c.v.ConfigFileUsed(), data, os.ModePerm)
return os.WriteFile(c.v.ConfigFileUsed(), data, os.ModePerm)
}
// Config 站点配置
@@ -159,5 +158,5 @@ func (c *Config) Save() error {
if err != nil {
return err
}
return ioutil.WriteFile(c.v.ConfigFileUsed(), data, os.ModePerm)
return os.WriteFile(c.v.ConfigFileUsed(), data, os.ModePerm)
}

View File

@@ -4,7 +4,7 @@ import (
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -150,7 +150,7 @@ func (ns *NotificationServerBundle) Send(message string) error {
if resp.StatusCode < 200 || resp.StatusCode > 299 {
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)
return fmt.Errorf("%d@%s %s", resp.StatusCode, resp.Status, string(body))
}