mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
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:
@@ -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.")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user