We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05bd576 commit 0688c3bCopy full SHA for 0688c3b
credentials/oauth/lock.go
@@ -2,6 +2,8 @@ package oauth
2
3
import (
4
"fmt"
5
+ "os"
6
+ "path/filepath"
7
"sync"
8
9
"github.com/alexflint/go-filemutex"
@@ -29,6 +31,10 @@ func (l *lockerAdaptor) Unlock() {
29
31
}
30
32
33
func newLocker(path string) (sync.Locker, error) {
34
+ dirName := filepath.Dir(path)
35
+ if _, err := os.Stat(dirName); err != nil && os.IsNotExist(err) {
36
+ os.MkdirAll(dirName, 0750)
37
+ }
38
m, err := filemutex.New(path)
39
if err != nil {
40
return nil, err
0 commit comments