1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 10:07:02 +00:00

chore: remove refs to deprecated io/ioutil (#376)

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
guangwu
2023-08-08 07:25:36 +08:00
committed by GitHub
parent 926f9f3804
commit 0ae452ed17
8 changed files with 16 additions and 19 deletions

View File

@@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"net/mail"
"os"
@@ -192,7 +191,7 @@ func TestGetLatestMessage(t *testing.T) {
// setupDataStore creates a new FileDataStore in a temporary directory
func setupDataStore(cfg config.Storage, extHost *extension.Host) (*Store, *bytes.Buffer) {
path, err := ioutil.TempDir("", "inbucket")
path, err := os.MkdirTemp("", "inbucket")
if err != nil {
panic(err)
}
@@ -228,7 +227,7 @@ func deliverMessage(ds *Store, mbName string, subject string, date time.Time) (s
meta.To[0].Address, meta.From.Address, subject)
delivery := &message.Delivery{
Meta: meta,
Reader: ioutil.NopCloser(strings.NewReader(testMsg)),
Reader: io.NopCloser(strings.NewReader(testMsg)),
}
id, err := ds.AddMessage(delivery)
if err != nil {