mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-05 17:37:03 +00:00
Replace uses of ioutil
ioutil package was deprecated in Go 1.16, replace all uses with their respective replacements. This patch was generated with a combination of `gofmt -r`, `eg`, and manually (for `ioutil.ReadDir`).
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"bufio"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/textproto"
|
||||
"os"
|
||||
@@ -62,7 +61,7 @@ func (s *FakeServer) rootCA() *x509.CertPool {
|
||||
s.t.Helper()
|
||||
pool := x509.NewCertPool()
|
||||
path := s.tmpDir + "/cert.pem"
|
||||
data, err := ioutil.ReadFile(path)
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
s.t.Fatalf("error reading cert %q: %v", path, err)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package courier
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -25,7 +24,7 @@ func TestMDA(t *testing.T) {
|
||||
t.Fatalf("Deliver: %v", err)
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadFile(dir + "/to")
|
||||
data, err := os.ReadFile(dir + "/to")
|
||||
if err != nil || !bytes.Equal(data, []byte("data")) {
|
||||
t.Errorf("Invalid data: %q - %v", string(data), err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user