diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-08-17 16:19:45 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-08-22 09:30:19 +0200 |
commit | 9cffc45f0347e5c8b801c151955fa9326b9b2ba7 (patch) | |
tree | 4de8e74f1ec7378297185f65807cb9019caf1a1a /worker/lib | |
parent | 1b91b68e7385239783bee818974c4ce2032b7039 (diff) | |
download | aerc-9cffc45f0347e5c8b801c151955fa9326b9b2ba7.tar.gz |
go: removed io/ioutil
Since the minimum required version of Go has been bumped to 1.16, the
deprecation of io/ioutil can now be acted upon. This Commit removes the
remaining dependencies on ioutil and replaces them with their io or os
counterparts.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/lib')
-rw-r--r-- | worker/lib/parse_test.go | 5 | ||||
-rw-r--r-- | worker/lib/search.go | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/worker/lib/parse_test.go b/worker/lib/parse_test.go index 7e5bb367..227b121e 100644 --- a/worker/lib/parse_test.go +++ b/worker/lib/parse_test.go @@ -2,7 +2,6 @@ package lib import ( "io" - "io/ioutil" "os" "path/filepath" "testing" @@ -12,7 +11,7 @@ import ( func TestMessageInfoParser(t *testing.T) { rootDir := "testdata/message/valid" - msgFiles, err := ioutil.ReadDir(rootDir) + msgFiles, err := os.ReadDir(rootDir) die(err) for _, fi := range msgFiles { @@ -37,7 +36,7 @@ func TestMessageInfoParser(t *testing.T) { func TestMessageInfoHandledError(t *testing.T) { rootDir := "testdata/message/invalid" - msgFiles, err := ioutil.ReadDir(rootDir) + msgFiles, err := os.ReadDir(rootDir) die(err) for _, fi := range msgFiles { diff --git a/worker/lib/search.go b/worker/lib/search.go index 551d33cd..fe1ec114 100644 --- a/worker/lib/search.go +++ b/worker/lib/search.go @@ -1,7 +1,7 @@ package lib import ( - "io/ioutil" + "io" "net/textproto" "strings" "unicode" @@ -129,7 +129,7 @@ func searchMessage(message RawMessage, criteria *searchCriteria, return false, err } defer reader.Close() - bytes, err := ioutil.ReadAll(reader) + bytes, err := io.ReadAll(reader) if err != nil { return false, err } @@ -141,7 +141,7 @@ func searchMessage(message RawMessage, criteria *searchCriteria, return false, err } defer reader.Close() - bytes, err := ioutil.ReadAll(reader) + bytes, err := io.ReadAll(reader) if err != nil { return false, err } |