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
+3 -2
View File
@@ -1,6 +1,7 @@
package specconv
import (
"errors"
"os"
"strings"
"testing"
@@ -609,7 +610,7 @@ func TestDupNamespaces(t *testing.T) {
}
func TestUserNamespaceMappingAndPath(t *testing.T) {
if _, err := os.Stat("/proc/self/ns/user"); os.IsNotExist(err) {
if _, err := os.Stat("/proc/self/ns/user"); errors.Is(err, os.ErrNotExist) {
t.Skip("Test requires userns.")
}
@@ -643,7 +644,7 @@ func TestUserNamespaceMappingAndPath(t *testing.T) {
}
func TestNonZeroEUIDCompatibleSpecconvValidate(t *testing.T) {
if _, err := os.Stat("/proc/self/ns/user"); os.IsNotExist(err) {
if _, err := os.Stat("/proc/self/ns/user"); errors.Is(err, os.ErrNotExist) {
t.Skip("Test requires userns.")
}