testing: use time.Since instead of time.Now().Sub

Change-Id: Ia0479f65a6ef033a65acf9ac8692777839a53b8c
Reviewed-on: https://go-review.googlesource.com/61990
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Daniel Martí 2017-09-06 21:13:06 +02:00
parent 6367c19f26
commit 261a8d9abd
3 changed files with 3 additions and 3 deletions

View file

@ -701,7 +701,7 @@ func tRunner(t *T, fn func(t *T)) {
t.Errorf("race detected during execution of test")
}
t.duration += time.Now().Sub(t.start)
t.duration += time.Since(t.start)
// If the test panicked, print any test output before dying.
err := recover()
if !t.finished && err == nil {