From c8596328e7f769fdd313f981bb3b2de38b40c80c Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Sat, 2 May 2020 16:18:17 +1000 Subject: ipc: remove unnecessary error check os.MkdirAll never returns an os.IsExist error. Signed-off-by: David Crawshaw --- ipc/uapi_bsd.go | 3 +-- ipc/uapi_linux.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'ipc') diff --git a/ipc/uapi_bsd.go b/ipc/uapi_bsd.go index 75cc0e3..a74a7ed 100644 --- a/ipc/uapi_bsd.go +++ b/ipc/uapi_bsd.go @@ -151,8 +151,7 @@ func UAPIOpen(name string) (*os.File, error) { // check if path exist - err := os.MkdirAll(socketDirectory, 0755) - if err != nil && !os.IsExist(err) { + if err := os.MkdirAll(socketDirectory, 0755); err != nil { return nil, err } diff --git a/ipc/uapi_linux.go b/ipc/uapi_linux.go index a3c95ca..dce6a45 100644 --- a/ipc/uapi_linux.go +++ b/ipc/uapi_linux.go @@ -148,8 +148,7 @@ func UAPIOpen(name string) (*os.File, error) { // check if path exist - err := os.MkdirAll(socketDirectory, 0755) - if err != nil && !os.IsExist(err) { + if err := os.MkdirAll(socketDirectory, 0755); err != nil { return nil, err } -- cgit v1.2.3