Skip to content

Commit

Permalink
fix not cross-os file lock (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
jirfag committed Oct 14, 2019
1 parent 48599c6 commit fa69ddf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/commands/executor.go
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"time"

"github.com/golangci/golangci-lint/internal/cache"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fa69ddf

Please sign in to comment.