diff options
author | David Crawshaw <crawshaw@tailscale.com> | 2020-05-02 16:18:17 +1000 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-05-02 02:02:09 -0600 |
commit | c8596328e7f769fdd313f981bb3b2de38b40c80c (patch) | |
tree | c8d01ecd88f0f13c5817dfc3c9bb3c67309fc8bb /ipc | |
parent | 28c4d043048e8bb7167e96df6558a6366306fc17 (diff) |
ipc: remove unnecessary error check
os.MkdirAll never returns an os.IsExist error.
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/uapi_bsd.go | 3 | ||||
-rw-r--r-- | ipc/uapi_linux.go | 3 |
2 files changed, 2 insertions, 4 deletions
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 } |