Skip to content

Commit

Permalink
remove mkdir all
Browse files Browse the repository at this point in the history
  • Loading branch information
sk91 committed Nov 9, 2022
1 parent bab025f commit 55ffc3a
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions filemutex_flock.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package filemutex

import (
"os"
"path/filepath"

"golang.org/x/sys/unix"
)
Expand All @@ -33,10 +32,6 @@ func NewWithMode(filename string, perm os.FileMode) (*FileMutex, error) {
}

func new(filename string, perm os.FileMode) (*FileMutex, error) {
dir := filepath.Dir(filename)
if err := os.MkdirAll(dir, os.FileMode(perm)); err != nil {
return nil, err
}
fd, err := unix.Open(filename, unix.O_CREAT|unix.O_RDONLY, uint32(perm))
if err != nil {
return nil, err
Expand Down

0 comments on commit 55ffc3a

Please sign in to comment.