From 72bb593eda86a457a2969b1bf9203ef57386452c Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 30 Aug 2022 16:29:14 +0300 Subject: [PATCH] io/ioutil is deprecated since Go 1.16 --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 } -- 2.44.0