Bench log file is created non-portably, only works on system where
"/tmp" existed and "/" is path separator.
Fixing this by using portable methods from std lib.
Updates #56345
Change-Id: I1f6b6b97b913ca56a6053beca7025652618ecbf3
Reviewed-on: https://go-review.googlesource.com/c/go/+/478355
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
"log/slog/internal/buffer"
"math"
"os"
+ "path/filepath"
"strings"
"testing"
"time"
}),
}
- outFile, err := os.Create("/tmp/bench.log")
+ outFile, err := os.Create(filepath.Join(b.TempDir(), "bench.log"))
if err != nil {
b.Fatal(err)
}