From fa69ddfc14ff9da080e14607d07d73e34750b426 Mon Sep 17 00:00:00 2001 From: Isaev Denis Date: Mon, 14 Oct 2019 19:46:59 +0300 Subject: [PATCH] fix not cross-os file lock (#818) --- pkg/commands/executor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/commands/executor.go b/pkg/commands/executor.go index 1d4e05f64b59..975a3c507588 100644 --- a/pkg/commands/executor.go +++ b/pkg/commands/executor.go @@ -8,6 +8,7 @@ import ( "fmt" "io" "os" + "path/filepath" "time" "github.com/golangci/golangci-lint/internal/cache" @@ -205,7 +206,7 @@ func computeConfigSalt(cfg *config.Config) ([]byte, error) { } func (e *Executor) acquireFileLock() bool { - lockFile := os.TempDir() + "/golangci-lint.lock" + lockFile := filepath.Join(os.TempDir(), "golangci-lint.lock") e.debugf("Locking on file %s...", lockFile) f := flock.New(lockFile) ctx, finish := context.WithTimeout(context.Background(), time.Minute)