aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/email/parser.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2023-02-23 14:28:18 +0100
committerGitHub <noreply@github.com>2023-02-23 14:28:18 +0100
commit4359978ef22a22ddd5a19adf18cbc80cb44244fb (patch)
tree7952da94e27417b39ddf952d9e0bab431dafc4c5 /pkg/email/parser.go
parent9e2ebb3c174f1e168bc1fbadd5f02f2e25e314fc (diff)
all: ioutil is deprecated in go1.19 (#3718)
Diffstat (limited to 'pkg/email/parser.go')
-rw-r--r--pkg/email/parser.go5
1 files changed, 2 insertions, 3 deletions
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)
}