You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is really more of a question of how I should be handling validating timestamps. Right now we're using the testify/assert package but I suppose we could deserialize and use [t.Equal()] for true timestamp validation (https://golang.org/pkg/time/#Time.Equal).
The text was updated successfully, but these errors were encountered:
Darwin and Alpine are entirely different operating systems with entirely different kernels. There is no particular reason to think that they will provide the same timestamp precision. Go is just providing the best information that it has, so this difference doesn't really have anything to do with Go.
I'm not sure what you mean by "validating timestamps." You will get a better answer for that kind of question on a forum; see https://golang.org/wiki/Questions.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Just saw the 1.14 release on twitter land, I shall try this shortly
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
given the following code in
time.go
:and the following Dockerfile:
you can run the following steps (within the workdir):
go run time.go
docker build -t time-test . && docker run -it --rm --name time-test time-test
and you will yield two different results; same time, however different levels of specificity.
go run time.go
yields:2020-02-25 23:09:23.59933 +0000 UTC
(darwin)docker time.go
yields:2020-02-25 23:09:50.499543766 +0000 UTC
(alpine)What did you expect to see?
I would expect to see the same level of accuracy within both implementations however...
What did you see instead?
I get microsecond accuracy on darwin vs nanosecond accuracy on alpine.
I did find this stackoverflow Q&A on the topic of accuracy in my searches: https://stackoverflow.com/questions/14610459/how-precise-is-gos-time-really
This is really more of a question of how I should be handling validating timestamps. Right now we're using the testify/assert package but I suppose we could deserialize and use [t.Equal()] for true timestamp validation (https://golang.org/pkg/time/#Time.Equal).
The text was updated successfully, but these errors were encountered: