time: add /etc/zoneinfo as valid path for tzdata for NixOS

NixOS has no /usr/share, but does have tzdata at /etc/zoneinfo.

Change-Id: Ic7d7f42a215e06c2e4f5c54ee11db82240f27167
GitHub-Last-Rev: 9969dd3e2c
GitHub-Pull-Request: golang/go#58267
Reviewed-on: https://go-review.googlesource.com/c/go/+/464995
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
David Anderson 2023-02-02 20:13:46 +00:00 committed by Brad Fitzpatrick
parent 86c4b0a6ec
commit 82e0465355
1 changed files with 3 additions and 1 deletions

View File

@ -16,11 +16,13 @@ import (
)
// Many systems use /usr/share/zoneinfo, Solaris 2 has
// /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ.
// /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ,
// NixOS has /etc/zoneinfo.
var platformZoneSources = []string{
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
"/etc/zoneinfo",
}
func initLocal() {