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:
Moritz Poldrack 2022-08-17 16:19:45 +02:00 committed by Robin Jarry
parent 1b91b68e73
commit 9cffc45f03
20 changed files with 34 additions and 47 deletions
widgets

View file

@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"net/textproto"
"os"
"os/exec"
@ -92,7 +91,7 @@ func NewComposer(aerc *Aerc, acct *AccountView, conf *config.AercConfig,
logging.Errorf("could not complete header: %v", err)
})
email, err := ioutil.TempFile("", "aerc-compose-*.eml")
email, err := os.CreateTemp("", "aerc-compose-*.eml")
if err != nil {
// TODO: handle this better
return nil, err
@ -454,7 +453,7 @@ func (c *Composer) readSignatureFromFile() []byte {
if err != nil {
return nil
}
signature, err := ioutil.ReadFile(sigFile)
signature, err := os.ReadFile(sigFile)
if err != nil {
c.aerc.PushError(
fmt.Sprintf(" Error loading signature from file: %v", sigFile))