Skip to content

Commit f2b79ca

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 165a96e commit f2b79ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/runtime/syscall_windows_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ func BenchmarkRunningGoProgram(b *testing.B) {
10371037
defer os.RemoveAll(tmpdir)
10381038

10391039
src := filepath.Join(tmpdir, "main.go")
1040-
err = ioutil.WriteFile(src, []byte(benchmarkRunnigGoProgram), 0666)
1040+
err = ioutil.WriteFile(src, []byte(benchmarkRunningGoProgram), 0666)
10411041
if err != nil {
10421042
b.Fatal(err)
10431043
}
@@ -1060,9 +1060,11 @@ func BenchmarkRunningGoProgram(b *testing.B) {
10601060
}
10611061
}
10621062

1063-
const benchmarkRunnigGoProgram = `
1063+
const benchmarkRunningGoProgram = `
10641064
package main
10651065
1066+
import _ "os" // average Go program will use "os" package, do the same here
1067+
10661068
func main() {
10671069
}
10681070
`

0 commit comments

Comments
 (0)