Fix fs error handling

This commit is contained in:
Daniel
2022-10-11 14:49:06 +02:00
parent b53b77e28c
commit 1144ac589b
8 changed files with 25 additions and 16 deletions

View File

@@ -33,7 +33,7 @@ func checkAndCreateInstanceLock(path, name string, perUser bool) (pid int32, err
// read current pid file
data, err := os.ReadFile(lockFilePath)
if err != nil {
if os.IsNotExist(err) {
if errors.Is(err, fs.ErrNotExist) {
// create new lock
return 0, createInstanceLock(lockFilePath)
}