aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gen-device-svd
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2022-08-05 13:18:48 -0700
committerRon Evans <[email protected]>2022-08-07 10:32:23 +0200
commita2704f1435c8c26e072f036c32820571498b9052 (patch)
treed55091269813504dbf74d6ed97266b522a18d291 /tools/gen-device-svd
parentedbbca5614fc5694d0c631cbcea73c7e2e90b336 (diff)
downloadtinygo-a2704f1435c8c26e072f036c32820571498b9052.tar.gz
tinygo-a2704f1435c8c26e072f036c32820571498b9052.zip
all: move from os.IsFoo to errors.Is(err, ErrFoo)
Diffstat (limited to 'tools/gen-device-svd')
-rwxr-xr-xtools/gen-device-svd/gen-device-svd.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/gen-device-svd/gen-device-svd.go b/tools/gen-device-svd/gen-device-svd.go
index cb14c2c54..f10b7d239 100755
--- a/tools/gen-device-svd/gen-device-svd.go
+++ b/tools/gen-device-svd/gen-device-svd.go
@@ -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)
}