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>
This commit is contained in:
parent
1b91b68e73
commit
9cffc45f03
20 changed files with 34 additions and 47 deletions
commands
|
@ -3,7 +3,7 @@ package account
|
|||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
|
@ -89,7 +89,7 @@ func (Recover) Execute(aerc *widgets.Aerc, args []string) error {
|
|||
return nil, err
|
||||
}
|
||||
defer recoverFile.Close()
|
||||
data, err := ioutil.ReadAll(recoverFile)
|
||||
data, err := io.ReadAll(recoverFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path"
|
||||
|
@ -124,7 +123,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
|
|||
}
|
||||
|
||||
if attachFull {
|
||||
tmpDir, err := ioutil.TempDir("", "aerc-tmp-attachment")
|
||||
tmpDir, err := os.MkdirTemp("", "aerc-tmp-attachment")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package msgview
|
|||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime"
|
||||
"os"
|
||||
"time"
|
||||
|
@ -60,7 +59,7 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error {
|
|||
}
|
||||
}
|
||||
|
||||
tmpFile, err := ioutil.TempFile(os.TempDir(), "aerc-*"+extension)
|
||||
tmpFile, err := os.CreateTemp(os.TempDir(), "aerc-*"+extension)
|
||||
if err != nil {
|
||||
aerc.PushError(err.Error())
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue