all: move from os.IsFoo to errors.Is(err, ErrFoo)

This commit is contained in:
Damian Gryski
2022-08-05 13:18:48 -07:00
committed by Ron Evans
parent edbbca5614
commit a2704f1435
9 changed files with 27 additions and 13 deletions
+3 -1
View File
@@ -10,8 +10,10 @@ package testing
import (
"bytes"
"errors"
"flag"
"fmt"
"io/fs"
"os"
"strings"
"time"
@@ -277,7 +279,7 @@ func (c *common) TempDir() string {
nonExistent = true
} else {
_, err := os.Stat(c.tempDir)
nonExistent = os.IsNotExist(err)
nonExistent = errors.Is(err, fs.ErrNotExist)
if err != nil && !nonExistent {
c.Fatalf("TempDir: %v", err)
}