]> Cypherpunks repositories - gostls13.git/commit
time: simplify Duration.String example
authorRuss Cox <rsc@golang.org>
Fri, 22 May 2020 00:53:45 +0000 (20:53 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 22 May 2020 11:28:55 +0000 (11:28 +0000)
commit9acdc705e7d53a59b8418dd0beb570db35f7a744
treecf6e538b6845b0e20047da61623d93d0a4b44840
parentea2de3346ff8714c9fae95c2a3d686ec07d47ca8
time: simplify Duration.String example

The existing example is needlessly complex.
You have to know that t.Sub returns a Duration
and also have to mentally subtract the two times
to understand what duration should be printed.

Rewrite to focus on just the Duration.String operation.

Change-Id: I00765b6019c07a6ff03022625b556c2b9ba87c09
Reviewed-on: https://go-review.googlesource.com/c/go/+/234893
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/time/example_test.go