Fix bincache on windows
This commit is contained in:
parent
0e20dc105b
commit
57ab50a4a7
1 changed files with 6 additions and 1 deletions
|
@ -10,6 +10,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -107,5 +108,9 @@ func (c *ciBuildCache) GetBinary(importPath string) (string, error) {
|
||||||
func RandomName() string {
|
func RandomName() string {
|
||||||
var raw [8]byte
|
var raw [8]byte
|
||||||
_, _ = rand.Read(raw[:])
|
_, _ = rand.Read(raw[:])
|
||||||
return hex.EncodeToString(raw[:])
|
name := hex.EncodeToString(raw[:])
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
name += ".exe"
|
||||||
|
}
|
||||||
|
return name
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue