3 ms·
The main problem I got out of the article was that the stateful timezone of the entire process does not get set until `time.Format` gets called. I think that's
by amw-zero 5y ago
The main problem I got out of the article was that the stateful timezone of the entire process does not get set until `time.Format` gets called. I think that's a legitimate criticism - which part made you think that `reflect.DeepEqual` is at fault?
- xyzzy_plugh 5y agoDeepEqual is simply inappropriate here. It's fundamentally problematic to do deep comparisons on types you don't have visibility into. You're not entitled to manage the fields, so you lack any guarantee that the implementation matches your expectations. Maybe comparisons require holding a lock, maybe there's a pointer to a shared object (like in this instance), maybe there's some reference to CGo stuff. It's just not the right way to go about it. If the language lacked reflection, how would you solve this problem?
- amw-zero 5y agoCan you try addressing what I said? You’re really hung up on the deep equality check. As I said, I don’t think that’s the root of the issue. The root issue is time.Format changing the global time zone unexpectedly. Do you have an opinion on that?