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
@@ -3,8 +3,10 @@ package main
import (
"bufio"
"encoding/xml"
"errors"
"flag"
"fmt"
"io/fs"
"os"
"path/filepath"
"regexp"
@@ -1402,7 +1404,7 @@ __isr_vector:
}
func generate(indir, outdir, sourceURL, interruptSystem string) error {
if _, err := os.Stat(indir); os.IsNotExist(err) {
if _, err := os.Stat(indir); errors.Is(err, fs.ErrNotExist) {
fmt.Fprintln(os.Stderr, "cannot find input directory:", indir)
os.Exit(1)
}