From 4e2eff4c9b7a4c67c7c0af5f226f3292065c9dca Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 6 Jul 2017 03:39:58 +0000 Subject: [PATCH] time: document the Time.String is meant for debugging Fixes #20876 Change-Id: Ic62c4f59e3ddcae891aa9526f9693d233dd524fc Reviewed-on: https://go-review.googlesource.com/47552 Reviewed-by: Russ Cox Reviewed-by: Joe Tsai --- src/time/format.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/time/format.go b/src/time/format.go index 852138977beb7..8c16e873f64ea 100644 --- a/src/time/format.go +++ b/src/time/format.go @@ -430,6 +430,10 @@ func formatNano(b []byte, nanosec uint, n int, trim bool) []byte { // If the time has a monotonic clock reading, the returned string // includes a final field "m=±", where value is the monotonic // clock reading formatted as a decimal number of seconds. +// +// The returned string is meant for debugging; for a stable serialized +// representation, use t.MarshalText, t.MarshalBinary, or t.Format +// with an explicit format string. func (t Time) String() string { s := t.Format("2006-01-02 15:04:05.999999999 -0700 MST")