From 4359978ef22a22ddd5a19adf18cbc80cb44244fb Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Thu, 23 Feb 2023 14:28:18 +0100 Subject: all: ioutil is deprecated in go1.19 (#3718) --- pkg/email/parser.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'pkg/email/parser.go') diff --git a/pkg/email/parser.go b/pkg/email/parser.go index e2d3d0ab8..9de71f731 100644 --- a/pkg/email/parser.go +++ b/pkg/email/parser.go @@ -7,7 +7,6 @@ import ( "encoding/base64" "fmt" "io" - "io/ioutil" "mime" "mime/multipart" "mime/quotedprintable" @@ -367,14 +366,14 @@ func parseBody(r io.Reader, headers mail.Header) ([]byte, [][]byte, error) { } disp, _, _ := mime.ParseMediaType(headers.Get("Content-Disposition")) if disp == "attachment" { - attachment, err := ioutil.ReadAll(r) + attachment, err := io.ReadAll(r) if err != nil { return nil, nil, fmt.Errorf("failed to read email body: %v", err) } return nil, [][]byte{attachment}, nil } if mediaType == "text/plain" { - body, err := ioutil.ReadAll(r) + body, err := io.ReadAll(r) if err != nil { return nil, nil, fmt.Errorf("failed to read email body: %v", err) } -- cgit mrf-deployment