fix not cross-os file lock ()

This commit is contained in:
Isaev Denis 2019-10-14 19:46:59 +03:00 committed by GitHub
parent 48599c64ba
commit fa69ddfc14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)