cmd/sgblog-comment-add/mail.go | 3 +-- cmd/sgblog-comment-add/main.go | 4 ++-- cmd/sgblog/main.go | 4 ++-- common.go | 4 ++-- diff --git a/cmd/sgblog-comment-add/mail.go b/cmd/sgblog-comment-add/mail.go index 3b442175325bd336b50cd6c34fe821b1519645c3e7117962a5f35dac7e069206..61c13fad445ce1fb9f7aa9f1ce8b454c146705b209aaa7893e5409e485ec4876 100644 --- a/cmd/sgblog-comment-add/mail.go +++ b/cmd/sgblog-comment-add/mail.go @@ -22,7 +22,6 @@ "bytes" "encoding/base64" "errors" "io" - "io/ioutil" "mime" "mime/multipart" "mime/quotedprintable" @@ -84,7 +83,7 @@ if len(boundary) == 0 { err = errors.New("no boundary string") return } - data, err := ioutil.ReadAll(msg.Body) + data, err := io.ReadAll(msg.Body) if err != nil { return } diff --git a/cmd/sgblog-comment-add/main.go b/cmd/sgblog-comment-add/main.go index 09de6cb055bc85d2120a2a73bf301dfda72d48e3cdd89496f2e1f4a39c002a18..7c23dc7dc61b76d6fc4f21bde36acca1e7956ab5b36bc4caf357d967f4019878 100644 --- a/cmd/sgblog-comment-add/main.go +++ b/cmd/sgblog-comment-add/main.go @@ -24,7 +24,7 @@ "crypto/sha1" "encoding/hex" "flag" "fmt" - "io/ioutil" + "io" "log" "mime" "net/mail" @@ -103,7 +103,7 @@ subj, r, err := parseEmail(msg) if err != nil { log.Fatal(err) } - body, err := ioutil.ReadAll(r) + body, err := io.ReadAll(r) if err != nil { log.Fatal(err) } diff --git a/cmd/sgblog/main.go b/cmd/sgblog/main.go index 48ed0d5dc4bfb88cf4a79743075c23dd2cdc9bf4f5b1dcac1c98da4d5eca837a..e31671e1bc8d93a23686132a5666978778412cc16022c2694814e6696c78fae8 100644 --- a/cmd/sgblog/main.go +++ b/cmd/sgblog/main.go @@ -23,8 +23,8 @@ "crypto/sha1" "encoding/json" "flag" "fmt" - "io/ioutil" "log" + "os" "regexp" "strings" @@ -126,7 +126,7 @@ return &headHash, nil } func readCfg(cfgPath string) (*Cfg, error) { - cfgRaw, err := ioutil.ReadFile(cfgPath) + cfgRaw, err := os.ReadFile(cfgPath) if err != nil { return nil, err } diff --git a/common.go b/common.go index 1ec5609267f04cacf954d8e30742c6e57d52f4801ebf7566df3125085b33e990..172ecac91647ed708dfbe96d37c9ad0a3266afc1b5e820fa4091ebf9965c33a3 100644 --- a/common.go +++ b/common.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "io/ioutil" + "io" "sort" "text/scanner" @@ -81,7 +81,7 @@ r, err := blob.Reader() if err != nil { return nil } - data, err := ioutil.ReadAll(r) + data, err := io.ReadAll(r) if err != nil { return nil }