Skip to content

Commit fa69ddf

Browse files
authored
fix not cross-os file lock (#818)
1 parent 48599c6 commit fa69ddf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/commands/executor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99
"io"
1010
"os"
11+
"path/filepath"
1112
"time"
1213

1314
"github.com/golangci/golangci-lint/internal/cache"
@@ -205,7 +206,7 @@ func computeConfigSalt(cfg *config.Config) ([]byte, error) {
205206
}
206207

207208
func (e *Executor) acquireFileLock() bool {
208-
lockFile := os.TempDir() + "/golangci-lint.lock"
209+
lockFile := filepath.Join(os.TempDir(), "golangci-lint.lock")
209210
e.debugf("Locking on file %s...", lockFile)
210211
f := flock.New(lockFile)
211212
ctx, finish := context.WithTimeout(context.Background(), time.Minute)

0 commit comments

Comments
 (0)