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
@@ -1,13 +1,15 @@
package main
import (
"errors"
"io"
"io/fs"
"os"
)
func main() {
_, err := os.Open("non-exist")
if !os.IsNotExist(err) {
if !errors.Is(err, fs.ErrNotExist) {
panic("should be non exist error")
}