]> Cypherpunks.ru repositories - gostls13.git/commit
time: rewrite the documentation for layout strings
authorRob Pike <r@golang.org>
Mon, 17 May 2021 00:30:01 +0000 (10:30 +1000)
committerRob Pike <r@golang.org>
Tue, 18 May 2021 02:39:04 +0000 (02:39 +0000)
commit5e191f8f4885cac105b6d7069e02c0c8d149c22c
treec2db16fad0b7f7f0c4e0830a5017f624bcd6f57f
parentbfe3573d58d7c49c4d58e0ab392eb0b5a660d262
time: rewrite the documentation for layout strings

People continue to be confused by how these work. Address that by some
rejiggering.

Introduce a constant called Layout that both defines the time and
provides a reference point for Parse and Format to refer to. We can
then delete much redundancy, especially for Format's comments, but
Parse tightens a bit too.

Then change the way the concept of the layout string is introduced,
and provide a clearer catalog of what its elements are.

Fixes #38871

Change-Id: Ib967ae70c7d5798a97b865cdda1fda4daed8a99a
Reviewed-on: https://go-review.googlesource.com/c/go/+/320252
Trust: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/time/format.go