]> Sergey Matveev's repositories - uploader.git/commitdiff
io/ioutil is deprecated since Go 1.16
authorSergey Matveev <stargrave@stargrave.org>
Tue, 30 Aug 2022 13:29:14 +0000 (16:29 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 30 Aug 2022 13:29:14 +0000 (16:29 +0300)
main.go

diff --git a/main.go b/main.go
index e31ae19cbf3839f45cbc5b095e29d3b45a814677..365895dc1cd03a1918ae313282c155e166d7f6bf 100644 (file)
--- 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
        }