From 2dd110f9a73b369bebc1f1d99576ab2170827652 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 1 Nov 2017 17:06:52 +0100 Subject: [PATCH] runtime/pprof: use switch for GOOS check in testCPUProfile Since CL 33071, testCPUProfile is only one user of the badOS map. Replace it by the corresponding switch, with the "plan9" case removed because it is already checked earlier in the same function. Change-Id: Id647b8ee1fd37516bb702b35b3c9296a4f56b61b Reviewed-on: https://go-review.googlesource.com/75110 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/pprof/pprof_test.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index 81c44af2b7..b138420728 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -177,7 +177,8 @@ func testCPUProfile(t *testing.T, need []string, f func(dur time.Duration)) { } } - if badOS[runtime.GOOS] { + switch runtime.GOOS { + case "darwin", "dragonfly", "netbsd", "solaris": t.Skipf("ignoring failure on %s; see golang.org/issue/13841", runtime.GOOS) } // Ignore the failure if the tests are running in a QEMU-based emulator, @@ -392,15 +393,6 @@ func TestMathBigDivide(t *testing.T) { }) } -// Operating systems that are expected to fail the tests. See issue 13841. -var badOS = map[string]bool{ - "darwin": true, - "netbsd": true, - "plan9": true, - "dragonfly": true, - "solaris": true, -} - func TestBlockProfile(t *testing.T) { type TestCase struct { name string -- 2.48.1