diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go index f9d665650b..cb46c2a5dc 100644 --- a/src/runtime/crash_cgo_test.go +++ b/src/runtime/crash_cgo_test.go @@ -10,6 +10,7 @@ import ( "bytes" "fmt" "internal/testenv" + "os" "os/exec" "runtime" "strings" @@ -250,6 +251,7 @@ func TestCgoPprof(t *testing.T) { t.Fatal(err) } fn := strings.TrimSpace(string(got)) + defer os.Remove(fn) top, err := exec.Command("go", "tool", "pprof", "-top", "-nodecount=1", exe, fn).CombinedOutput() if err != nil {