[go] time: document that LoadLocation creates new Location instances

0 views
Skip to first unread message

Sean Liao (Gerrit)

unread,
9:39 AM (6 hours ago) 9:39 AM
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Sean Liao has uploaded the change for review

Commit message

time: document that LoadLocation creates new Location instances

Fixes #77385
Change-Id: I7e7ddb1c71f0aebd893f640d476b273e229b059a

Change diff

diff --git a/src/time/zoneinfo.go b/src/time/zoneinfo.go
index f0444a5..faa5691 100644
--- a/src/time/zoneinfo.go
+++ b/src/time/zoneinfo.go
@@ -645,12 +645,13 @@
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
diff --git a/src/time/zoneinfo_read.go b/src/time/zoneinfo_read.go
index 047e360..1f13455 100644
--- a/src/time/zoneinfo_read.go
+++ b/src/time/zoneinfo_read.go
@@ -111,7 +111,7 @@

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).

Change information

Files:
  • M src/time/zoneinfo.go
  • M src/time/zoneinfo_read.go
Change size: S
Delta: 2 files changed, 6 insertions(+), 5 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I7e7ddb1c71f0aebd893f640d476b273e229b059a
Gerrit-Change-Number: 743040
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Liao <se...@liao.dev>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
unsatisfied_requirement
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages