ipc: remove unnecessary error check

os.MkdirAll never returns an os.IsExist error.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw 2020-05-02 16:18:17 +10:00 committed by Jason A. Donenfeld
parent 28c4d04304
commit c8596328e7
2 changed files with 2 additions and 4 deletions

View File

@ -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
}

View File

@ -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
}