Replace os.Is* error checking functions with their errors.Is counterpart

Signed-off-by: Curd Becker <me@curd-becker.de>
This commit is contained in:
Curd Becker
2025-11-17 00:28:05 +01:00
parent e0adafb4ca
commit 536e183451
15 changed files with 40 additions and 36 deletions
+2 -2
View File
@@ -91,7 +91,7 @@ created by an unprivileged user.
if err == nil {
return fmt.Errorf("File %s exists. Remove it first", name)
}
if !os.IsNotExist(err) {
if !errors.Is(err, os.ErrNotExist) {
return err
}
return nil
@@ -117,7 +117,7 @@ created by an unprivileged user.
func loadSpec(cPath string) (spec *specs.Spec, err error) {
cf, err := os.Open(cPath)
if err != nil {
if os.IsNotExist(err) {
if errors.Is(err, os.ErrNotExist) {
return nil, fmt.Errorf("JSON specification file %s not found", cPath)
}
return nil, err