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

@ -87,7 +87,7 @@ func runExample(eg InternalExample) (ok bool) {
// Clean up in a deferred call so we can recover if the example panics.
defer func() {
dstr := fmtDuration(time.Now().Sub(start))
dstr := fmtDuration(time.Since(start))
// Close pipe, restore stdout, get output.
w.Close()