fix not cross-os file lock (#818)
This commit is contained in:
parent
48599c64ba
commit
fa69ddfc14
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user