From: Alex Brainman Date: Wed, 8 Mar 2017 03:58:41 +0000 (+1100) Subject: runtime: import os package in BenchmarkRunningGoProgram X-Git-Tag: go1.9beta1~1067 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f2b79cadfde436a824a12b40e096b4fe6c8249d7;p=gostls13.git runtime: import os package in BenchmarkRunningGoProgram I would like to use BenchmarkRunningGoProgram to measure changes for issue #15588. So the program in the benchmark should import "os" package. It is also reasonable that basic Go program includes "os" package. For #15588. Change-Id: Ida6712eab22c2e79fbe91b6fdd492eaf31756852 Reviewed-on: https://go-review.googlesource.com/37914 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go index 11e67df100..099baa2edf 100644 --- a/src/runtime/syscall_windows_test.go +++ b/src/runtime/syscall_windows_test.go @@ -1037,7 +1037,7 @@ func BenchmarkRunningGoProgram(b *testing.B) { defer os.RemoveAll(tmpdir) src := filepath.Join(tmpdir, "main.go") - err = ioutil.WriteFile(src, []byte(benchmarkRunnigGoProgram), 0666) + err = ioutil.WriteFile(src, []byte(benchmarkRunningGoProgram), 0666) if err != nil { b.Fatal(err) } @@ -1060,9 +1060,11 @@ func BenchmarkRunningGoProgram(b *testing.B) { } } -const benchmarkRunnigGoProgram = ` +const benchmarkRunningGoProgram = ` package main +import _ "os" // average Go program will use "os" package, do the same here + func main() { } `