Commit e49d074c authored by Radek Sohlich's avatar Radek Sohlich Committed by Ian Lance Taylor

time: example in doc for time.AppendFormat func

The simple example would contribute to better understanding
what function does.

Change-Id: I36a2952df8b0e1762ec0cd908a867c457f39366e
Reviewed-on: https://go-review.googlesource.com/75970Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 37b15baa
......@@ -569,3 +569,14 @@ func ExampleTime_Sub() {
// Output:
// difference = 12h0m0s
}
func ExampleTime_AppendFormat() {
t := time.Date(2017, time.November, 4, 11, 0, 0, 0, time.UTC)
text := []byte("Time: ")
text = t.AppendFormat(text, time.Kitchen)
fmt.Println(string(text))
// Output:
// Time: 11:00AM
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment