]> Cypherpunks repositories - gostls13.git/commitdiff
time: document that LoadLocation creates new Location instances
authorSean Liao <sean@liao.dev>
Sat, 7 Feb 2026 14:38:05 +0000 (14:38 +0000)
committerSean Liao <sean@liao.dev>
Thu, 12 Feb 2026 20:37:31 +0000 (12:37 -0800)
Fixes #77385

Change-Id: I7e7ddb1c71f0aebd893f640d476b273e229b059a
Reviewed-on: https://go-review.googlesource.com/c/go/+/743040
Reviewed-by: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
src/time/zoneinfo.go
src/time/zoneinfo_read.go

index f0444a5d9daf178816472042a8e42d4f39072cd7..faa569125946c9ff8428251561be0dc2587ec294 100644 (file)
@@ -645,12 +645,13 @@ var errLocation = errors.New("time: invalid location name")
 var zoneinfo *string
 var zoneinfoOnce sync.Once
 
-// LoadLocation returns the Location with the given name.
+// LoadLocation returns a [Location] with the given name.
 //
-// If the name is "" or "UTC", LoadLocation returns UTC.
-// If the name is "Local", LoadLocation returns Local.
+// If the name is "" or "UTC", LoadLocation returns [UTC].
+// If the name is "Local", LoadLocation returns [Local].
 //
-// Otherwise, the name is taken to be a location name corresponding to a file
+// Otherwise, a new [Location] is created where the name is taken
+// to be a location name corresponding to a file
 // in the IANA Time Zone database, such as "America/New_York".
 //
 // LoadLocation looks for the IANA Time Zone database in the following
index 047e360d11ae9dd81a9f5cd113cf2611c4870847..1f134556ece2bf912b395251b2d048a270f13fcd 100644 (file)
@@ -111,7 +111,7 @@ func byteString(p []byte) string {
 
 var errBadData = errors.New("malformed time zone information")
 
-// LoadLocationFromTZData returns a Location with the given name
+// LoadLocationFromTZData returns a new [Location] with the given name
 // initialized from the IANA Time Zone database-formatted data.
 // The data should be in the format of a standard IANA time zone file
 // (for example, the content of /etc/localtime on Unix systems).