From: Sergey Matveev Date: Tue, 30 Aug 2022 13:29:14 +0000 (+0300) Subject: io/ioutil is deprecated since Go 1.16 X-Git-Tag: v1.5.0~3 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=72bb593eda86a457a2969b1bf9203ef57386452c;p=uploader.git io/ioutil is deprecated since Go 1.16 --- diff --git a/main.go b/main.go index e31ae19..365895d 100644 --- a/main.go +++ b/main.go @@ -26,7 +26,6 @@ import ( "fmt" "html/template" "io" - "io/ioutil" "log" "mime" "net" @@ -167,14 +166,14 @@ func upload(w http.ResponseWriter, r *http.Request) { var commentLines []string p, err = mr.NextPart() if err == nil && p.FormName() == CommentFieldName { - comment, err := ioutil.ReadAll(p) + comment, err := io.ReadAll(p) if err == nil && len(comment) > 0 { commentLines = strings.Split(string(comment), "\n") wr.WriteFieldMultiline("Comment", commentLines) } } - ioutil.WriteFile(tai+".rec", rec.Bytes(), os.FileMode(0666)) + os.WriteFile(tai+".rec", rec.Bytes(), os.FileMode(0666)) if *NotifyToAddr == "" { return }