mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-14 20:33:59 +02:00
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
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"fmt"
|
||||
"image"
|
||||
"image/gif"
|
||||
"io/fs"
|
||||
"math/big"
|
||||
"math/rand"
|
||||
"os"
|
||||
@@ -56,6 +57,14 @@ var eq = qt.CmpEquals(
|
||||
cmp.Comparer(func(p1, p2 os.FileInfo) bool {
|
||||
return p1.Name() == p2.Name() && p1.Size() == p2.Size() && p1.IsDir() == p2.IsDir()
|
||||
}),
|
||||
cmp.Comparer(func(d1, d2 fs.DirEntry) bool {
|
||||
p1, err1 := d1.Info()
|
||||
p2, err2 := d2.Info()
|
||||
if err1 != nil || err2 != nil {
|
||||
return false
|
||||
}
|
||||
return p1.Name() == p2.Name() && p1.Size() == p2.Size() && p1.IsDir() == p2.IsDir()
|
||||
}),
|
||||
cmp.Comparer(func(p1, p2 *genericResource) bool { return p1 == p2 }),
|
||||
cmp.Comparer(func(m1, m2 media.Type) bool {
|
||||
return m1.Type() == m2.Type()
|
||||
|
Reference in New Issue
Block a user