From a669467d98f54860fa7f06fbfdd1d8fdc98773fd Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Wed, 1 Mar 2023 09:34:13 +0100 Subject: Misc ioutil deprecation adjustments To make the tests pass. * Replace io => os.ReadFile in magefile.go * Adjust failing image test vs fs.DirEntry * Adjust poller test See #10732 --- watcher/filenotify/poller_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'watcher') diff --git a/watcher/filenotify/poller_test.go b/watcher/filenotify/poller_test.go index 336314fff..7416f793a 100644 --- a/watcher/filenotify/poller_test.go +++ b/watcher/filenotify/poller_test.go @@ -34,10 +34,14 @@ func TestPollerAddRemove(t *testing.T) { c.Assert(w.Add("foo"), qt.Not(qt.IsNil)) c.Assert(w.Remove("foo"), qt.Not(qt.IsNil)) - f, err := os.CreateTemp(t.TempDir(), "asdf") + f, err := os.CreateTemp("", "asdf") if err != nil { t.Fatal(err) } + c.Cleanup(func() { + c.Assert(w.Close(), qt.IsNil) + os.Remove(f.Name()) + }) c.Assert(w.Add(f.Name()), qt.IsNil) c.Assert(w.Remove(f.Name()), qt.IsNil) -- cgit v1.2.3