-
Notifications
You must be signed in to change notification settings - Fork 18k
time: LoadLocation doesn't work on Linux if tzdata dependency not installed #38013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've filed #38017 as a proposal for a time/tzdata package. Please comment or emoji vote there about this idea. Thanks. |
Change https://golang.org/cl/224588 mentions this issue: |
Does anyone know how non-Go problems address this issue on Linux distributions? |
@leighmcculloch it IS go problem, cause time package forcely load data from constant directory path, and you can't change it. This issue not about go as language, but go as stdlib. So, yes, this problem is related to go as it could be. |
@andybons could you please add |
@ololosha228 That doesn't really answer @leighmcculloch 's question, though. It seems like a good question to me. I'll add the |
Change https://golang.org/cl/228101 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.12.7 linux/amd64
Does this issue reproduce with the latest release?
Yeup, on all go versions
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Absolutely same thing as in #21881 (code example). Problem is that zoneinfo is so large for packing it in binary file (800kb). But: as on windows, zone info package is not required for any Linux distro.
How did i found this issue: when you packing your go binary even with
-ldflags '-d -s -w'
(static build for non-libc distros), usingtime.LoadLocation()
always requiretzdata
dependency. This is awful, when you trying to pack your app in docker images without package manager (busybox, custom enterprise images). That's bad behavior.Actually, same problem is with net/http, when you try to connect using tls/ssl. but with https problem is explainable: ssl certificates updates often.
What did you expect to see?
Working example on pure linux system. Basically i expect to see way to manage this issue.
What did you see instead?
Program doesn't working 🙃
The text was updated successfully, but these errors were encountered: