Re: [go-nuts] json time format discrepancy

2019-10-09 Thread Andrey Tcherepanov
Thanks Anderson, I think I got a classical PEBKAC problem here, so all is 
good now.

On Wednesday, October 9, 2019 at 8:25:05 AM UTC-6, Anderson Queiroz wrote:
>
> Indeed looks odd, but as Jakob showed, it looks fine. I was playing 
> directly with the marshal/unmarshall and I didn't fine any problem either.
> My playground: https://play.golang.org/p/LLmQqxLKfME
>
> On Wednesday, 9 October 2019 07:29:29 UTC+2, Jakob Borg wrote:
>>
>> On 8 Oct 2019, at 19:27, Andrey Tcherepanov  
>> wrote:
>>
>>
>> In this case it loses subsecond precision, and it just bit me (doctor 
>> says I will live).
>>
>> Is it a bug or some historically-important reasons that I am missing are 
>> in play there?
>>
>>
>> I don't see this discrepancy: https://play.golang.org/p/uwpnmpcc_Bw
>>
>> Can you show your case?
>>
>> //jb
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/90019a8a-bfd9-4bd5-a556-7e1b9797b61e%40googlegroups.com.


Re: [go-nuts] json time format discrepancy

2019-10-09 Thread Andrey Tcherepanov
Thanks Jakob. I am shamefully have to concur that I indeed messed up. Now I 
need to find where did I do it though :)

Still curious - how RFC3339 works with parsing nanoseconds past decimal 
point?

Andrey

On Tuesday, October 8, 2019 at 11:29:29 PM UTC-6, Jakob Borg wrote:
>
> On 8 Oct 2019, at 19:27, Andrey Tcherepanov  > wrote:
>
>
> In this case it loses subsecond precision, and it just bit me (doctor says 
> I will live).
>
> Is it a bug or some historically-important reasons that I am missing are 
> in play there?
>
>
> I don't see this discrepancy: https://play.golang.org/p/uwpnmpcc_Bw
>
> Can you show your case?
>
> //jb
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1eef7941-4bf2-44ea-af39-24dff45ee4b3%40googlegroups.com.


Re: [go-nuts] json time format discrepancy

2019-10-09 Thread Anderson Queiroz
Indeed looks odd, but as Jakob showed, it looks fine. I was playing 
directly with the marshal/unmarshall and I didn't fine any problem either.
My playground: https://play.golang.org/p/LLmQqxLKfME

On Wednesday, 9 October 2019 07:29:29 UTC+2, Jakob Borg wrote:
>
> On 8 Oct 2019, at 19:27, Andrey Tcherepanov  > wrote:
>
>
> In this case it loses subsecond precision, and it just bit me (doctor says 
> I will live).
>
> Is it a bug or some historically-important reasons that I am missing are 
> in play there?
>
>
> I don't see this discrepancy: https://play.golang.org/p/uwpnmpcc_Bw
>
> Can you show your case?
>
> //jb
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/5e875000-15a8-4cf7-974b-a9854c35eb68%40googlegroups.com.


Re: [go-nuts] json time format discrepancy

2019-10-08 Thread Jakob Borg
On 8 Oct 2019, at 19:27, Andrey Tcherepanov 
mailto:xnow4fippy...@sneakemail.com>> wrote:

In this case it loses subsecond precision, and it just bit me (doctor says I 
will live).

Is it a bug or some historically-important reasons that I am missing are in 
play there?

I don't see this discrepancy: https://play.golang.org/p/uwpnmpcc_Bw

Can you show your case?

//jb

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7CD9C297-8BC9-4EF2-9289-1FCA2442AACB%40kastelo.net.


[go-nuts] json time format discrepancy

2019-10-08 Thread Andrey Tcherepanov
Fellas,

Would someone kind to point me to a reasoning behind "func (t Time) 
MarshalJSON() ([]byte, error)" use "time.RFC3339Nano" formatting to spit 
out time in JSON, and 
"func (t *Time) UnmarshalJSON(data []byte) error " uses "time.RFC3339" to 
parse the same timestamp? I do expect serialization/deserialization 
roundtrip to return exactly the same 
data as it was at the beginning. In this case it loses subsecond precision, 
and it just bit me (doctor says I will live).

Is it a bug or some historically-important reasons that I am missing are in 
play there?

Thank you in advance!

Andrey


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c594c813-adcc-4ad2-9f85-28284bf2ccb4%40googlegroups.com.