From 57ab50a4a7bd7dd301f3310735bb8e650f505b6d Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Sun, 16 Feb 2020 17:18:26 +0300 Subject: [PATCH] Fix bincache on windows --- tools/testtool/bincache.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/testtool/bincache.go b/tools/testtool/bincache.go index 24ae2ca..aa60c01 100644 --- a/tools/testtool/bincache.go +++ b/tools/testtool/bincache.go @@ -10,6 +10,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "sync" ) @@ -107,5 +108,9 @@ func (c *ciBuildCache) GetBinary(importPath string) (string, error) { func RandomName() string { var raw [8]byte _, _ = rand.Read(raw[:]) - return hex.EncodeToString(raw[:]) + name := hex.EncodeToString(raw[:]) + if runtime.GOOS == "windows" { + name += ".exe" + } + return name }