From 1de1357e7737a536c7f4ff6be7bd27977db4d2cb Mon Sep 17 00:00:00 2001 From: Shirou WAKAYAMA Date: Mon, 29 Feb 2016 21:59:02 +0900 Subject: [PATCH] [process]: add FailNow to avoid panic. --- process/process_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/process/process_test.go b/process/process_test.go index c5aac11..b79354b 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -374,6 +374,9 @@ func Test_CPUTimes(t *testing.T) { cpuTimes1, err := process.CPUTimes() assert.Nil(t, err) + if cpuTimes0 == nil || cpuTimes1 == nil { + t.FailNow() + } measuredElapsed := cpuTimes1.Total() - cpuTimes0.Total() message := fmt.Sprintf("Measured %fs != spun time of %fs\ncpuTimes0=%v\ncpuTimes1=%v", measuredElapsed, spinSeconds, cpuTimes0, cpuTimes1) -- GitLab